date_formatter 0.0.4 copy "date_formatter: ^0.0.4" to clipboard
date_formatter: ^0.0.4 copied to clipboard

Package for helping to format date from both string an datetime

example/main.dart

import 'package:date_formatter/date_formatter.dart';

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

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

  DateTime? dateTime = DateFormatter.toDateTime(
    date: '25-01-2023 12:45:00',
    inputFormat: 'dd-MM-yyyy HH:mm:ss',
  );
  print(dateTime);
}
13
likes
110
pub points
81%
popularity

Publisher

unverified uploader

Package for helping to format date from both string an datetime

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, intl

More

Packages that depend on date_formatter