date_format 1.0.0 copy "date_format: ^1.0.0" to clipboard
date_format: ^1.0.0 copied to clipboard

outdatedDart 1 only

Format Dates.

example/date_format_example.dart

import 'package:date_format/date_format.dart';

main() {
  print(formatDate(new DateTime(1989, 02, 21), [yyyy, '-', mm, '-', dd]));
  print(formatDate(new DateTime(1989, 02, 21), [yy, '-', m, '-', dd]));
  print(formatDate(new DateTime(1989, 02, 1), [yy, '-', m, '-', d]));

  print(formatDate(new DateTime(1989, 02, 1), [yy, '-', MM, '-', d]));
  print(formatDate(new DateTime(1989, 02, 1), [yy, '-', M, '-', d]));

  print(formatDate(new DateTime(1989, 02, 1), [yy, '-', M, '-', d]));

  print(formatDate(new DateTime(1989, 02, 1), [yy, '-', M, '-', DD]));
  print(formatDate(new DateTime(1989, 02, 1), [yy, '-', M, '-', D]));
}