yearMonthDay static method
DateTimeFormatter
yearMonthDay({
- Locale? locale,
- DateTimeAlignment? alignment,
- DateTimeLength? length,
- YearStyle? yearStyle,
Formatting the year, month, and day.
Example:
import 'package:intl4x/datetime_format.dart';
void main() {
final date = DateTime(2021, 12, 17, 4, 0, 42);
print(DateTimeFormat.yearMonthDay().format(date)); // Output: 'Dec 17, 2021'
}
Implementation
static DateTimeFormatter yearMonthDay({
Locale? locale,
DateTimeAlignment? alignment,
DateTimeLength? length,
YearStyle? yearStyle,
}) => DateTimeFormatImpl.build(
locale ?? findSystemLocale(),
).ymd(alignment: alignment, length: length, yearStyle: yearStyle);