Usage Note 44074: IS8601 time zone format and informat differences
With SAS code in general, time zone information is not preserved, whether Daylight Savings Time(DST) or moving time zones across the world.
Some informats and formats in the ISO 8601 category write datetime values in the Coordinated Universal Time (UTC) time scale using ISO 8601 datetime and time zone basic notation.
When formatting datetime values with the E8601DZ format, datetime values are assumed to be in Greenwich Mean Time(GMT). This means that the output is always the datetime followed by +00:00. The 9.3 documentation for this format incorrectly states that the datetime value is followed by an hour and minute signed offset from zero meridian time.
A datetime value including the GMT offset is read with the E8601DZ informat. The provided offset is used to create a datetime value that uses the GMT offset.
data _null_;
x=input('2011-08-01T12:34:56-04:00',e8601dz25.);
put x=e8601dz25.;
run;
The result is x=2011-08-01T16:34:56+00:00
Notice the input time of 12:34:56-04:00 converted to output of 16:34:56+00:00. The offset is 4 hours earlier than GMT, and when the value is read with the E8601DZ informat, the value is converted to GMT to be 16:34 (or 4:34pm). The value is displayed by E8601DZ with a 00:00 offset. Use + for time zones east of the zero meridian and use - for time zones west of the zero meridian.
The E8601LZ format outputs values showing the GMT offset. The input value must be a SAS time value rather than a datetime value. The format queries the SAS host code to determine the offset, and then it is used.
data _null_;
x=time();
put x=e8601lz.;
run;
The result is x=current time-04:00
The number of hours shown as the offset are determined by the coder's time zone. If the code is run in an Eastern Standard Time area, the offset is -05:00, etc.
Operating System and Release Information
SAS System | Base SAS | Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |
Microsoft® Windows® for x64 | 9.2 TS1M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |
z/OS | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |
Microsoft Windows XP Professional | 9.2 TS1M0 | |
Windows Vista | 9.2 TS1M0 | |
Windows Vista for x64 | 9.2 TS1M0 | |
64-bit Enabled AIX | 9.2 TS1M0 | |
64-bit Enabled HP-UX | 9.2 TS1M0 | |
64-bit Enabled Solaris | 9.2 TS1M0 | |
HP-UX IPF | 9.2 TS1M0 | |
Linux | 9.2 TS1M0 | |
Linux for x64 | 9.2 TS1M0 | |
OpenVMS on HP Integrity | 9.2 TS1M0 | |
Solaris for x64 | 9.2 TS1M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | |
Topic: | SAS Reference ==> Formats ==> Date and Time
|
Date Modified: | 2012-02-02 15:39:52 |
Date Created: | 2011-08-23 09:11:21 |