Patterns for Instant values

The Instant type supports the following patterns:

Standard Patterns

The following standard pattern is supported:

  • g: General format pattern.
    The ISO-8601 representation of this instant in UTC, using the pattern "uuuu-MM-ddTHH:mm:ss'Z'" and always using the invariant culture, with the default "start of time" and "end of time" labels. This is the default format pattern.

Custom Patterns

Instant supports all the LocalDateTime custom patterns. The pattern allows the culture to be specified, but always uses the ISO-8601 calendar, and always uses the UTC time zone. The "template value" is always the unix epoch.

All instant patterns handle Instant.MinValue and Instant.MaxValue separately. The default formatting of the values are simply "MinInstant" and "MaxInstant" respectively, but a new InstantPattern with different min/max labels can be created using the WithMinMaxLabels method. The labels must be non-empty strings which differ from each other.