DateTimeFormat class sealed

DateTime formatting.

This class provides static methods to create DateTimeFormatter instances for various common date and time formats.

Example:

import 'package:intl4x/datetime_format.dart';

void main() {
  final date = DateTime(2021, 12, 17, 4, 0, 42);
  print(DateTimeFormat.time(locale: Locale.parse('fr')).format(date));
  // Output: '04:00'
}

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

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

Static Methods

day({Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length}) DateTimeFormatter
Formatting just the day.
month({Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length}) DateTimeFormatterStandalone
Formatting just the month.
monthDay({Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length}) DateTimeFormatter
Formatting the month and day.
monthDayTime({Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, TimePrecision? timePrecision}) DateTimeFormatter
Formatting the month, day, and time.
time({Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, TimePrecision? timePrecision}) DateTimeFormatter
Formatting just the time.
year({Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, YearStyle? yearStyle}) DateTimeFormatterStandalone
Formatting just the year.
yearMonthDay({Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, YearStyle? yearStyle}) DateTimeFormatter
Formatting the year, month, and day.
yearMonthDayTime({Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, TimePrecision? timePrecision, YearStyle? yearStyle}) DateTimeFormatter
Formatting the year, month, day, and time.
yearMonthDayWeekday({Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, YearStyle? yearStyle}) DateTimeFormatter
Formatting the year, month, day, and weekday.
yearMonthDayWeekdayTime({Locale? locale, DateTimeAlignment? alignment, DateTimeLength? length, TimePrecision? timePrecision, YearStyle? yearStyle}) DateTimeFormatter
Formatting the year, month, day, weekday, and time.