date_formatted_2024 0.0.4
date_formatted_2024: ^0.0.4 copied to clipboard
A Dart package providing various extensions on DateTime for easy and flexible date formatting.
import 'package:date_formatted_2024/date_formatted_2024.dart';
void main() {
DateTime now = DateTime.now();
// Using the DateFormateExtension to format the date
print(now.formatToDDMonthYYYY()); // prints: DD/Month/YYYY
print(now.formatToYYYYMonthDD()); // prints: YYYY/Month/DD
print(now.formatToDDMonthYYYYWithDash()); // prints: DD-Month-YYYY
print(now.formatToYYYYMonthDDWithDash()); // prints: YYYY-Month-DD
print(now.formatToDDMMYYYY()); // prints: DD/MM/YYYY
print(now.formatToYYYYMMDD()); // prints: YYYY/MM/DD
print(now.formatToDDMMYYYYWithDash()); // prints: DD-MM-YYYY
print(now.formatToYYYYMMDDWithDash()); // prints: YYYY-MM-DD
print(now.formatToDDMMYYYYHHMM()); // prints: DD/MM/YYYY HH:MM
print(now.formatToYYYYMMDDHHMM()); // prints: YYYY/MM/DD HH:MM
print(now.formatToDDMMYYYYWithDashHHMM()); // prints: DD-MM-YYYY HH:MM
print(now.formatToYYYYMMDDWithDashHHMM()); // prints: YYYY-MM-DD HH:MM
print(now.formatToDDMMYYYYHHMMSS()); // prints: DD/MM/YYYY HH:MM:SS
print(now.formatToYYYYMMDDHHMMSS()); // prints: YYYY/MM/DD HH:MM:SS
}