DateTimeFormatter class abstract

DateTime formatter.

Custom formatter can be created by extending this class. The format method must be implemented.

Example:

class CustomFormatter implements DateTimeFormatter {
    const CustomFormatter();

    @override
    String format(DateTime date) {
      // Format the date and return the formatted string.
    }

    @override
    String get specifier => 'custom';
}
Implementers

Constructors

DateTimeFormatter()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
specifier String
Defined the format specifier.
no setter

Methods

format(DateTime date) String
Format the given date and return the formatted string.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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