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

outdated

A simple API to format dates. Provides various constants to build Date format string. Use `formatDate` method to format date according to format string.

date_format #

A simple API to format dates.

Usage #

Use formatDate function to format a DateTime

print(formatDate(DateTime(1989, 02, 21), [yyyy, '-', mm, '-', dd]));

Output:

1989-02-21

Long month names #

print(formatDate(DateTime(1989, 2, 21), [yy, '-', M, '-', d]));

Output:

89-feb-21

Time parts #

print(formatDate(
      DateTime(1989, 02, 1, 15, 40, 10), [HH, ':', nn, ':', ss]));

Output:

15:40:10

Timezone #

print(formatDate(
      DateTime(1989, 02, 1, 15, 40, 10), [HH, ':', nn, ':', ss, z]));

Output:

15:40:10+0100

419
likes
0
pub points
99%
popularity

Publisher

unverified uploader

A simple API to format dates. Provides various constants to build Date format string. Use `formatDate` method to format date according to format string.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on date_format