Formats |
Category: | Date and Time |
ISO 8601 | |
Alignment: | left |
Alias: | IS8601LZ |
Time Zone Format: | Yes. The format appends the UTC offset to the value as determined by the local SAS session. |
ISO 8601 Element: | 5.3.1.1 Complete representation |
Syntax | |
Syntax Description | |
Details | |
Examples | |
See Also |
Syntax |
E8601LZw. |
specifies the width of the output field.
Default: | 14 |
Range: | 9 - 20 |
Details |
The E8602LZ format writes time values without making any adjustments and appends the UTC time zone offset for the local SAS session, using one of the following ISO 8601 extended time notations:
hh:mm:ss+|-hh:mm |
is the form used when w is large enough to support this time notation. |
hh:mm:ssZ |
is the form used when w is not large enough to support the +|- hh:mm time zone notation. |
hh |
is a two-digit hour (zero padded), between 00 - 23. | ||
mm |
is a two-digit minute (zero padded), between 00 - 59. | ||
ss |
is a two-digit second (zero padded), between 00 - 59. | ||
Z |
indicate zero meridian (Greenwich, England) or UTC time. | ||
+|-hh:mm |
is an hour and minute signed offset from zero meridian time. Note that the offset must be +|-hh:mm (that is, + or - and five characters). Use + for time zones east of the zero meridian and use - for time zones west of the zero meridian. For example, +02:00 indicates a two hour time difference to the east of the zero meridian, and -06:00 indicates a six hour time differences to the west of the zero meridian.
|
SAS writes the time value using the form hh:mm.ffffff and appends the time zone indicator +|-hh:mm based on the time zone offset from the zero meridian for the local SAS session, or Z. The Z time zone indicator is used for format lengths that are less than 14.
If the same time is written using both zone indicators, they indicate two different times based on the UTC. For example, if the local SAS session uses Eastern Standard Time in the US, and the time value is 45824, SAS would write 12:43:44-04:00 or 12:43:44Z. The time 12:43:44-04:00 is the time 16:43:44+00:00 at the zero meridian. The Z indicates that the time is the time at the zero meridian, or 12:43:44+00:00.
When SAS reads a UTC time by using the E8601TZ informat, and the adjusted time is greater than 24 hours or less than 00 hours, SAS adjusts the value so that the time is between 00:00:00 and 24:00:00. If the E8601TZ format attempts to format a time outside of this time range, the time is formatted with stars to indicate that the value is out of range.
Examples |
The following PUT statement write the time for the Eastern Standard time zone. put elz e8601lz.;
Value of elz | Results |
---|---|
46380 |
12:53:00-5:00 |
See Also |
Working with Dates and Times Using the ISO 8601 Basic and Extended Notations |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.