$N8601Bw.d Format

Writes ISO 8601 duration, datetime, and interval forms by using the basic notations PnYnMnDTnHnMnS and yyyymmddThhmmss.
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

$N8601Bw.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 $N8601B format writes ISO 8601 duration, datetime, and interval values as character data for the following basic notations:
  • PnYnMnDTnHnMnS
  • yyyymmddThhmmss
  • PnYnMnDTnHnMnS/yyyymmddThhmmss
  • yyyymmddThhmmssT/PnYnMnDTnHnMnS
The lowest-order component can contain fractions, as in these examples:
  • p2y3.5m
  • p00020304T05.335

Example

put nb $n8601b.;
Value of nb
Result
0002405050112FFC
P2Y4M5DT5H1M12S
2012915155300FFD
20120915T155300
2012915000000FFD2014915000000FFD
20120915T000000/20140915T000000
0033104030255FFC2012915155300FFD
P33Y1M4DT3H2M55S/20120915T155300