easy_date_formatter 1.0.1 copy "easy_date_formatter: ^1.0.1" to clipboard
easy_date_formatter: ^1.0.1 copied to clipboard

Package for helping to format date from both string an datetime

example/main.dart

import 'package:easy_date_formatter/easy_date_formatter.dart';

void main() {
  String formattedDate = DateFormatter.formatDateTime(
    dateTime: DateTime.now(),
    outputFormat: 'dd/MM/yyyy',
  );
  // ignore: avoid_print
  print(formattedDate);

  String formattedStringDate = DateFormatter.formatStringDate(
    date: '25-01-2023 12:45:00',
    inputFormat: 'dd-MM-yyyy HH:mm:ss',
    outputFormat: 'dd MMM, yyyy',
  );
  // ignore: avoid_print
  print(formattedStringDate);

  DateTime? dateTime = DateFormatter.toDateTime(
    date: '25-01-2023 12:45:00',
    inputFormat: 'dd-MM-yyyy HH:mm:ss',
  );
  // ignore: avoid_print
  print(dateTime);
}
5
likes
145
points
76
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Package for helping to format date from both string an datetime

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, intl

More

Packages that depend on easy_date_formatter