v2.0.9
date_format
一個簡單的 API 用於格式化日期。提供各種常數來建立日期格式字串。使用 `formatDate` 方法根據格式字串格式化日期。
448喜歡 15.9萬近 30 天下載150Pub 分數
AndroidiOSWebmacOSWindowsLinux
格式化日期
^1.3.0以下為英文專案原文快照,最新內容請造訪 GitHub。
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