LocalDateTimePattern class

Represents a pattern for parsing and formatting LocalDateTime values.

Implemented types
Annotations
  • @immutable

Properties

hashCode int
The hash code for this object.
no setterinherited
patternText String
Gets the pattern text for this pattern, as supplied on creation.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
templateValue LocalDateTime
Get the value used as a template for parsing: any field values unspecified in the pattern are taken from the template.
final

Methods

appendFormat(LocalDateTime value, StringBuffer builder) StringBuffer
Formats the given value as text according to the rules of this pattern, appending to the given StringBuilder.
override
format(LocalDateTime value) String
Formats the given local date/time as text according to the rules of this pattern.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parse(String text) ParseResult<LocalDateTime>
Parses the given text value according to the rules of this pattern.
override
toString() String
A string representation of this object.
inherited
withCalendar(CalendarSystem calendar) LocalDateTimePattern
Creates a pattern like this one, but with the template value modified to use the specified calendar system.
withCulture(Culture culture) LocalDateTimePattern
Creates a pattern for the same original pattern text as this pattern, but with the specified culture.
withTemplateValue(LocalDateTime newTemplateValue) LocalDateTimePattern
Creates a pattern like this one, but with the specified template value.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

extendedIso LocalDateTimePattern
Gets an invariant local date/time pattern which is ISO-8601 compatible, providing up to 9 decimal places of sub-second accuracy. (These digits are omitted when unnecessary.) This corresponds to the text pattern "uuuu'-'MM'-'dd'T'HH':'mm':'ss;FFFFFFFFF".
no setter
fullRoundtrip LocalDateTimePattern
Gets an invariant local date/time pattern which round trips values including the calendar system. This corresponds to the text pattern "uuuu'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffff '('c')'".
no setter
fullRoundtripWithoutCalendar LocalDateTimePattern
Gets an invariant local date/time pattern which round trips values, but doesn't include the calendar system. It provides up to 9 decimal places of sub-second accuracy which are always present (including trailing zeroes). This corresponds to the text pattern "uuuu'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffff". It will round-trip all LocalDateTime values if the calendar system of the template value is the same as the calendar system of the original value.
no setter
generalIso LocalDateTimePattern
Gets an invariant local date/time pattern which is ISO-8601 compatible, down to the second. This corresponds to the text pattern "uuuu'-'MM'-'dd'T'HH':'mm':'ss", and is also used as the "sortable" standard pattern.
no setter
roundtrip LocalDateTimePattern
Gets an invariant local date/time pattern which is ISO-8601 compatible, providing up to 7 decimal places of sub-second accuracy which are always present (including trailing zeroes). This is compatible with the BCL round-trip formatting of DateTime values with a kind of 'unspecified'. This corresponds to the text pattern "uuuu'-'MM'-'dd'T'HH':'mm':'ss'.'fffffff". It does not necessarily round-trip all LocalDateTime values as it will lose sub-tick information. Use fullRoundtripWithoutCalendar
no setter

Static Methods

createWithCulture(String patternText, Culture culture, [LocalDateTime? templateValue]) LocalDateTimePattern
Creates a pattern for the given pattern text, culture, and template value.
createWithCurrentCulture(String patternText) LocalDateTimePattern
Creates a pattern for the given pattern text in the current thread's current culture.
createWithInvariantCulture(String patternText) LocalDateTimePattern
Creates a pattern for the given pattern text in the invariant culture.