B8601LXw. Format

Writes datetime values as local time by appending a time zone offset difference between the local time and UTC, using the ISO 8601 basic notation yyyymmddThhmmss+|–hhmm.

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

Syntax

B8601LXw

Syntax Description

w

specifies the width of the output field.

Default 26
Range 20–35

Details

The B8601LX format writes datetime values without making any adjustments, and appends the UTC time zone offset for the local SAS session by using the ISO 8601 basic datetime notation:
  • yyyymmddThhmmss+|–hhmm
yyyy
is a four-digit year.
mm
is a two-digit month (zero padded) between 01 and 12.
dd
is a two-digit day of the month (zero padded) between 01 and 31.
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.
+|–hhmm
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.

Example

This PUT statement writes the time for the Eastern Standard time zone:
blx='01Feb2013T12:34:56'dt;
put blx b8601lx.;
Value of blx
Result
1675341296
      20130201T123456-0500