DateTimeFormatter class sealed

Formatters that can format a DateTime with time zone information.

This class extends DateTimeFormatterStandalone and provides additional methods to format dates and times with time zone information.

Example:

import 'package:intl4x/datetime_format.dart';
void main() {
  final date = DateTime(2021, 12, 17, 4, 0, 42);
  print(DateTimeFormat.year().format(date)); // Output: '2021'
}
Inheritance

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

format(DateTime datetime) String
Formats the given datetime into a string according to the formatter's configured locale and options.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
withTimeZoneLong() ZonedDateTimeFormatter
Returns a ZonedDateTimeFormatter that formats the datetime with a long time zone name.
withTimeZoneLongGeneric() ZonedDateTimeFormatter
Returns a ZonedDateTimeFormatter that formats the datetime with a long generic non-location format (e.g. "Pacific Time").
withTimeZoneLongOffset() ZonedDateTimeFormatter
Returns a ZonedDateTimeFormatter that formats the datetime with a long localized GMT format (e.g. "GMT-08:00").
withTimeZoneShort() ZonedDateTimeFormatter
Returns a ZonedDateTimeFormatter that formats the datetime with a short time zone name.
withTimeZoneShortGeneric() ZonedDateTimeFormatter
Returns a ZonedDateTimeFormatter that formats the datetime with a short generic non-location format (e.g. "PT").
withTimeZoneShortOffset() ZonedDateTimeFormatter
Returns a ZonedDateTimeFormatter that formats the datetime with a short localized GMT format (e.g. "GMT-8").

Operators

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