SAS reads ISO 8601 dates,
times, and datetimes using various informats, and the resulting values
are SAS date, time, or datetime values. The following table shows
different date, time, and datetime forms and the informats that you
use to read them:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Convert to local time
with time zone
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Read the date from a
datetime
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Convert to local time
with time zone
|
|
|
|
|
YYYY-MM-DDThh:mm:ss.nnnnnn
|
|
|
|
YYYY-MM-DDThh:mm:ss.nnnnnn+|-hh:mm
|
2012-09-15T15:53:00+05:00
|
|
Read date from a datetime
|
|
|
|
When SAS reads an ISO
8601 value that specifies a time zone offset (+|-
hh:
mm or
+|-
hhmm), the time or datetime
value is adjusted to account for the offset. A SAS time or datetime
value for an ISO 8601 value with a time zone offset is the time or
datetime for the zero meridian (Greenwich, England). For example,
if SAS reads the datetime 2011–09–15T15:53:00+05:00
using the E8601DZ informat, the datetime value 1631703180 has been
adjusted for the five hour time zone difference. This datetime value
is the datetime value for the zero meridian. If you write this value
using the E8601DZ format, the value is 2011–09–15T10:53:00+00:00.
The hour specified after the T shows the five hour adjustment.