iso8601 static method

DurationPrinter iso8601()

Returns an ISO-8601 extended full-precision format representation.

Implementation

static DurationPrinter iso8601() => DurationPrinter((builder) => builder
  ..literal('P')
  ..sign()
  ..part(TimeUnit.year,
      printer: FixedNumberPrinter<int>().after('Y'), skipIfZero: true)
  ..part(TimeUnit.month,
      printer: FixedNumberPrinter<int>().after('M'), skipIfZero: true)
  ..part(TimeUnit.week,
      printer: FixedNumberPrinter<int>().after('W'), skipIfZero: true)
  ..part(TimeUnit.day, printer: FixedNumberPrinter<int>().after('D'))
  ..literal('T')
  ..part(TimeUnit.hour,
      printer: FixedNumberPrinter<int>().after('H'), skipIfZero: true)
  ..part(TimeUnit.minute,
      printer: FixedNumberPrinter<int>().after('M'), skipIfZero: true)
  ..part(TimeUnit.second)
  ..part(TimeUnit.microsecond,
      printer: FixedNumberPrinter<int>(padding: 6).before('.'),
      skipIfZero: true)
  ..literal('S'));