v2.0.9
date_format
A simple API to format dates. Provides various constants to build Date format string. Use `formatDate` method to format date according to format string.
448Likes 159.4K30-day downloads150Pub points
AndroidiOSWebmacOSWindowsLinux
Format Dates
^1.3.0English project snapshot. Visit GitHub for the latest content.
A simple API to format dates.
Use formatDate function to format a DateTime object.
print(formatDate(DateTime(1989, 02, 21), [yyyy, '-', mm, '-', dd]));
Output:
1989-02-21
print(formatDate(DateTime(1989, 2, 21), [yy, '-', M, '-', d]));
Output:
89-feb-21
print(formatDate(
DateTime(1989, 02, 1, 15, 40, 10), [HH, ':', nn, ':', ss]));
Output:
15:40:10
print(formatDate(
DateTime(1989, 02, 1, 15, 40, 10), [HH, ':', nn, ':', ss, z]));
Output:
15:40:10+0100