$N8601Ew.d Format

Writes ISO 8601 duration, datetime, and interval forms by using the extended notations PnYnMnDTnHnMnS and yyyy-mm-ddThh:mm:ss.

Categories: Date and Time
ISO 8601
Alignment: Left
Restriction: UTC time zone offset values are not supported.
Supports: ISO 8601 Element 5.4.4, complete representation

Syntax

$N8601Ew.d

Syntax Description

w

specifies the width of the output field.

Default 50
Range 1–200
Requirement The minimum length for a duration value or a datetime value is 16. The minimum length for an interval value is 16.

d

specifies the number of digits to the right of the lowest-order component. This argument is optional.

Default 0
Range 0–3

Details

The $N8601E format writes ISO 8601 duration, datetime, and interval values as character data for the following basic notations:
  • PnYnMnDTnHnMnS
  • yyyy-mm-ddThh:mm:ss
  • PnYnMnDTnHnMnS/yyyy-mm-ddThh:mm:ss
  • yyyy-mm-ddThh:mm:ssT/PnYnMnDTnHnMnS
The lowest-order component can contain fractions, as in these examples:
  • p2y3.5m
  • p0002–03–04T05.335

Example

put @1 ne $n8601e.;
Value of ne
Result
00024050501127D0
P2Y4M5DT5H1M12.5S
2012915155300FFD
2012-09-15T15:53:00
2012915000000FFD2014915000000FFD
2012-09-15T00:00:00/2013-09-15T00:00:00
0033104030255FFC2012915155300FFD
P33Y1M4DT3H2M55S/2012-09-15T15:53:00