The LocalDateTime
type supports the following patterns:
The following standard patterns are supported:
o
or O
: The round-trip pattern, which is always "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffff" using the invariant culture. The calendar
system is not round-tripped in this pattern, but it's compatible with the BCL round-trip pattern (for DateTime
values with a Kind
of Unspecified
, which is closest in meaning to LocalDateTime
).r
: The full round-trip pattern including calendar system, which is always "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffff '('c')'" using the invariant culture.s
: The sortable pattern, which is always "yyyy'-'MM'-'dd'T'HH':'mm':'ss" using the invariant culture. (Note: this is only truly sortable for years within the range [0-9999].)f
: The culture's long date pattern followed by a space,
followed by the short time pattern.F
: The full date and time pattern as defined by the culture's DateTimeFormatInfo.FullDateTimePattern
For example, in the invariant culture this is "dddd, dd MMMM yyyy HH:mm:ss".g
: The culture's short date pattern followed by a space,
followed by the short time pattern.G
: The culture's short date pattern followed by a space,
followed by the long time pattern.
This is the default format pattern.The custom format patterns for local date and time values are provided by combining the custom patterns for LocalDate
with
the custom patterns for LocalTime
. The result is simply the combination of the date and the time.