dtread(string[,format])

Returns a new date/time variable generated by reading a string. The string can be a variable, a constant, or the output of the $str function. The format may be omitted if the default parser can understand the string without it; if present, it must be surrounded by quote (") characters. The format is specified using characters such as commas, colons, hyphens, slashes, or whatever occurs in the data, combined with these key characters:
  • m
    : Month number (1-12), no leading zeros
  • mm
    : Month number (01-12), always two digits
  • mmm
    : Three letter abbreviation for month name, English only (Jan-Dec)
  • mmmm
    : Month name fully spelled out, English only
  • d
    : Day number (1-31), no leading zeros
  • dd
    : Day number (01-31), always two digits
  • y
    : Year (1-9999), no leading zeros, as many digits as needed
  • yy
    : Last two digits of year (00-99), interpreted within the range 1950-2049
  • yyyy
    : Four digit year
  • www
    : Three letter abbreviation for weekday name, English only (Sun-Sat)
  • wwww
    : Weekday name fully spelled out, English only
  • j
    : Day number in the year (1-366), no leading zeros
  • jjj
    : Day number in the year (001-366), always three digits
  • k
    : Week number (1-54), no leading zeros: Week 1 begins on January 1; the week number increments on each subsequent Sunday and is not affected by changing from one month to the next. The week number can be 54 only when a leap year begins on a Saturday.
  • kk
    : Week number (01-54), always two digits.
  • h
    : Hour (1-12 or 1-24), no leading zeros
  • hh
    : Hour (01-12 or 01-24), always two digits
  • m
    : Minute (1-59), no leading zeros
  • mm
    : Minute (01-59), always two digits
  • s
    : Second (1-59), no leading zeros
  • ss
    : Second (01-59), always two digits
  • t
    : Tenths of a second (0-9), one digit only
  • tt
    : Hundredths of a second (00-99), always two digits
  • ttt
    : Thousandths of a second (000-999), always three digits
  • a
    : a.m. and p.m. indicated by a single a or p
  • p
    : alternative for “a”
  • am
    : a.m. and p.m. indicated by the letters am or pm
  • pm
    : alternative for “am”
  • a.m.
    : a.m. and p.m. indicated by the characters “a.m.” or “p.m.”, with periods and no spaces
  • p.m.
    : alternative for “a.m.”
  • *: A single character that exists in the data and is to be ignored by the parser for the dtread transform
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.