createWithCurrentCulture static method

ZonedDateTimePattern createWithCurrentCulture(
  1. String patternText, [
  2. DateTimeZoneProvider? zoneProvider
])

Creates a pattern for the given pattern text and the specified or default time zone provider, using a strict resolver, the current culture, and a default template value of midnight January 1st 2000 UTC.

The resolver is only used if the pattern text doesn't include an offset. If the resulting zoneProvider is null, the resulting pattern can be used for formatting but not parsing. Note that the current culture is captured at the time this method is called

  • it is not captured at the point of parsing or formatting values.
  • patternText: Pattern text to create the pattern for
  • zoneProvider: Time zone provider, used when parsing text which contains a time zone identifier. If null, defaults to DateTimeZoneProviders.defaultProvider, which may also be null.

Returns: A pattern for parsing and formatting zoned date/times.

Implementation

static ZonedDateTimePattern createWithCurrentCulture(String patternText, [DateTimeZoneProvider? zoneProvider]) =>
    _create(patternText, TimeMachineFormatInfo.currentInfo, Resolvers.strictResolver, zoneProvider ?? DateTimeZoneProviders.defaultProvider, ZonedDateTimePatterns.defaultTemplateValue);