E8601TXw. Format

Adjusts a Coordinated Universal Time (UTC) value to the user local time. Then, writes the local time by using the ISO 8601 extended time notation hh:mm:ss+|–hh:mm.

Categories: Date and Time
ISO 8601
Alignment: Right
Supports: ISO 8601 Elements 5.3.3 and 5.3.4

Syntax

E8601TXw.

Syntax Description

w

specifies the width of the output field.

Default 14
Range 9–20

Details

UTC values specify a time based on the zero meridian in Greenwich, England. Using this format, SAS converts a time value to the UTC value and determines the user local time by using the value of the TIMEZONE= system option. If the TIMEZONE= option is not set, the user local time is based on the local time. The E8601TX format writes SAS datetime values by using the following ISO 8601 basic time notation:
  • hh:mm:ss+|–hh:mm
hh
is a two-digit hour (zero padded) between 00 and 23.
mm
is a two-digit minute (zero padded) between 00 and 59.
ss
is a two-digit second (zero padded) between 00 and 59.
+|–hh:mm
is an hour and minute signed offset from zero meridian time. The offset must be +|–hhmm (that is, + or – and four characters).
Use + for time zones east of the zero meridian, and use – for time zones west of the zero meridian. For example, +0200 indicates a two-hour time difference to the east of the zero meridian, and –0600 indicates a six-hour time difference to the west of the zero meridian.
Restriction: The shorter form +|-hh is not supported.
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 000000 and 240000. If the E8601TX format attempts to format a time outside of this time range, the time is formatted with asterisks to indicate that the value is out of range.

Example

The first example uses the local time to determine the time and the time zone offset. The second example changes the time zone to America/Adak, which is Hawaii-Aleutian Time.
Statement
Result
data _null_ ; 
t='12:34:56't;
put t e8601tx.; 
run;
07:34:56-05:00
options timezone='America/Adak';
data _null_ ; 
t='12:34:56't;
put t e8601tx.; 
run;
02:34:56-10:00