B8601DZw. Format

Writes datetime values for the zero meridian Coordinated Universal Time (UTC) time by using the ISO 8601 datetime and time zone basic notation yyyymmddThhmmss+0000.

Categories: Date and Time
ISO 8601
Alignment: Left
Supports: ISO 8601 Element 5.4.1, complete representation

Syntax

B8601DZw.

Syntax Description

w

specifies the width of the output field.

Default 26
Range 16–35

Details

UTC values specify a time and a time zone based on the zero meridian in Greenwich, England. The B8601DZ format writes SAS datetime values for the zero meridian date and time by using one of the following ISO 8601 basic datetime notations:
  • yyyymmddThhmmss+0000
    Note: Use this form when w is large enough to support this time zone notation.
  • yyyymmddThhmmssZ
    Note: Use this form when w is not large enough to support the +0000 time zone notation.
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.
+0000
indicates the UTC time for the zero meridian (Greenwich, England).
An ISO 8601 time or datetime value that specifies a time zone offset is adjusted by the number of hours and minutes that is specified in the offset. Then, the time zone offset is processed as the time or datetime for the zero meridian (Greenwich, England). The B8601DZ format always writes the datetime value by using the zero meridian offset value of +0000. To write a datetime that uses a time zone offset other than +0000, see B8601LZw. Format.
Restriction: The shorter form +00 is not supported.
Z
indicates that the time is for the zero meridian (Greenwich, England) or +0000 UTC time. Z is used when the width of the format does not support the +0000 notation.

Example

put bdz b8601dz20.;
Datetime Value
Value of bdz
Result
20110915T155300+0500
16317031801
20110915T105300+0000
20110915T155300Z
1631721180
20110915T155300+0000
1The ISO 8601 value specifies a time zone offset of five hours. When SAS read the value, the SAS datetime value was adjusted by five hours. The Result column shows the adjustment of five hours.