SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Reading Date and Time Values
Reading Dates and Times Using Informats


DATETIMEw. Informat

The DATETIMEw. informat reads expressions that are composed of two parts, a date value and a time value, in the form: ddmmmyy hh:mm:ss.ss.


General form, values read with DATETIMEw. informat:
ddmmmyy hh:mm:ss.ss

where

  • ddmmmyy is the date value, the same form as for the DATEw. informat
  • hh:mm:ss.ss is the required form of the time value
  • hh is an integer from 00 to 23, representing the hour
  • mm is an integer from 00 to 59, representing the minute
  • ss.ss is an optional field representing seconds and hundredths of seconds
Note that the date value and time value are separated by a blank or other delimiter.


If you do not enter a value for ss.ss, SAS software assumes a value of zero.

Here are some examples of the DATETIMEw. informat. Note that in the time value, delimiters are required to separate the values for hour, minutes, and seconds.


Date and Time Expression SAS Datetime Informat
 30May2000:10:03:17.2 DATETIME20.
 30May00 10:03:17.2 DATETIME18.
 30May2000/10:03 DATETIME15.



back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement