diff --git a/README.cn.md b/README.cn.md index 72d7f1c..85280a8 100644 --- a/README.cn.md +++ b/README.cn.md @@ -1571,8 +1571,6 @@ invalid timezone "xxx", please see the file "$GOROOT/lib/time/zoneinfo.zip" for | H | 小时,24 小时格式 | 2 | 00-23 | 15 | | i | 分钟 | 2 | 01-59 | 04 | | s | 秒数 | 2 | 01-59 | 05 | -| c | ISO8601 格式日期 | - | - | 2006-01-02T15:04:05-07:00 | -| r | RFC2822 格式日期 | - | - | Mon, 02 Jan 2006 15:04:05 -0700 | | O | 与格林威治时间相差的小时数 | - | - | -0700 | | P | 与格林威治时间相差的小时数,小时和分钟之间有冒号分隔 | - | - | -07:00 | | T | 时区缩写 | - | - | MST | diff --git a/README.jp.md b/README.jp.md index 8aec132..1c231e2 100644 --- a/README.jp.md +++ b/README.jp.md @@ -1567,8 +1567,6 @@ invalid timezone "xxx", please see the file "$GOROOT/lib/time/zoneinfo.zip" for | H | 時間, 24時間のフォーマット | 2 | 00-23 | 15 | | i | 分 | 2 | 01-59 | 04 | | s | 秒 | 2 | 01-59 | 05 | -| c | ISO8601 フォーマットの日付 | - | - | 2006-01-02T15:04:05-07:00 | -| r | RFC2822 フォーマットの日付 | - | - | Mon, 02 Jan 2006 15:04:05 -0700 | | O | グリニッジとの時間差の時間数 | - | - | -0700 | | P | グリニッジと時間の差の時間数, 時間と分の間にコロンがあります | - | - | -07:00 | | T | タイムゾーンの略語 | - | - | MST | diff --git a/README.md b/README.md index a3c3bc9..ab54fd4 100644 --- a/README.md +++ b/README.md @@ -1571,8 +1571,6 @@ invalid timezone "xxx", please see the file "$GOROOT/lib/time/zoneinfo.zip" for | H | Hour in 24-hour format, padded to 2 | 2 | 00-23 | 15 | | i | Minute, padded to 2 | 2 | 01-59 | 04 | | s | Second, padded to 2 | 2 | 01-59 | 05 | -| c | ISO8601 date | - | - | 2006-01-02T15:04:05-07:00 | -| r | RFC2822 date | - | - | Mon, 02 Jan 2006 15:04:05 -0700 | | O | Difference to Greenwich time (GMT) without colon between hours and minutes | - | - | -0700 | | P | Difference to Greenwich time (GMT) with colon between hours and minutes | - | - | -07:00 | | T | Abbreviated timezone | - | - | MST | diff --git a/helper.go b/helper.go index c4685d3..be81c47 100755 --- a/helper.go +++ b/helper.go @@ -8,28 +8,26 @@ import ( // common formatting symbols // 常规格式化符号 var formats = map[byte]string{ - 'd': "02", // Day: Day of the month, 2 digits with leading zeros. Eg: 01 to 31. - 'D': "Mon", // Day: A textual representation of a day, three letters. Eg: Mon through Sun. - 'j': "2", // Day: Day of the month without leading zeros. Eg: 1 to 31. - 'l': "Monday", // Day: A full textual representation of the day of the week. Eg: Sunday through Saturday. - 'F': "January", // Month: A full textual representation of a month, such as January or March. Eg: January through December. - 'm': "01", // Month: Numeric representation of a month, with leading zeros. Eg: 01 through 12. - 'M': "Jan", // Month: A short textual representation of a month, three letters. Eg: Jan through Dec. - 'n': "1", // Month: Numeric representation of a month, without leading zeros. Eg: 1 through 12. - 'Y': "2006", // Year: A full numeric representation of a year, 4 digits. Eg: 1999 or 2003. - 'y': "06", // Year: A two digit representation of a year. Eg: 99 or 03. - 'a': "pm", // Time: Lowercase morning or afternoon sign. Eg: am or pm. - 'A': "PM", // Time: Uppercase morning or afternoon sign. Eg: AM or PM. - 'g': "3", // Time: 12-hour format of an hour without leading zeros. Eg: 1 through 12. - 'h': "03", // Time: 12-hour format of an hour with leading zeros. Eg: 01 through 12. - 'H': "15", // Time: 24-hour format of an hour with leading zeros. Eg: 00 through 23. - 'i': "04", // Time: Minutes with leading zeros. Eg: 00 to 59. - 's': "05", // Time: Seconds with leading zeros. Eg: 00 through 59. - 'O': "-0700", // Zone: Difference to Greenwich time (GMT) in hours. Eg: +0200. - 'P': "-07:00", // Zone: Difference to Greenwich time (GMT) with colon between hours and minutes. Eg: +02:00. - 'T': "MST", // Zone: Timezone abbreviation. Eg: UTC, EST, MDT ... - 'c': "2006-01-02T15:04:05-07:00", // Format: ISO 8601 date. Eg: 2004-02-12T15:19:21+00:00. - 'r': "Thu, 21 Dec 2000 16:01:07 +0200", // Format: RFC 2822 formatted date. Eg: Thu, 21 Dec 2000 16:01:07 +0200. + 'd': "02", // Day: Day of the month, 2 digits with leading zeros. Eg: 01 to 31. + 'D': "Mon", // Day: A textual representation of a day, three letters. Eg: Mon through Sun. + 'j': "2", // Day: Day of the month without leading zeros. Eg: 1 to 31. + 'l': "Monday", // Day: A full textual representation of the day of the week. Eg: Sunday through Saturday. + 'F': "January", // Month: A full textual representation of a month, such as January or March. Eg: January through December. + 'm': "01", // Month: Numeric representation of a month, with leading zeros. Eg: 01 through 12. + 'M': "Jan", // Month: A short textual representation of a month, three letters. Eg: Jan through Dec. + 'n': "1", // Month: Numeric representation of a month, without leading zeros. Eg: 1 through 12. + 'Y': "2006", // Year: A full numeric representation of a year, 4 digits. Eg: 1999 or 2003. + 'y': "06", // Year: A two digit representation of a year. Eg: 99 or 03. + 'a': "pm", // Time: Lowercase morning or afternoon sign. Eg: am or pm. + 'A': "PM", // Time: Uppercase morning or afternoon sign. Eg: AM or PM. + 'g': "3", // Time: 12-hour format of an hour without leading zeros. Eg: 1 through 12. + 'h': "03", // Time: 12-hour format of an hour with leading zeros. Eg: 01 through 12. + 'H': "15", // Time: 24-hour format of an hour with leading zeros. Eg: 00 through 23. + 'i': "04", // Time: Minutes with leading zeros. Eg: 00 to 59. + 's': "05", // Time: Seconds with leading zeros. Eg: 00 through 59. + 'O': "-0700", // Zone: Difference to Greenwich time (GMT) in hours. Eg: +0200. + 'P': "-07:00", // Zone: Difference to Greenwich time (GMT) with colon between hours and minutes. Eg: +02:00. + 'T': "MST", // Zone: Timezone abbreviation. Eg: UTC, EST, MDT ... 'U': "timestamp", // Timestamp with second. Eg: 1699677240. 'V': "timestampMilli", // TimestampMilli with second. Eg: 1596604455666.