From 83dc90a29a4feb76954a25a0a003abb5087a6b5b Mon Sep 17 00:00:00 2001 From: gouguoyin <245629560@qq.com> Date: Sat, 7 Jan 2023 21:58:46 +0800 Subject: [PATCH] Add FromStdTime and ToStdTime methods --- README.md | 74 +++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 2d3613a7..9513fb0f 100644 --- a/README.md +++ b/README.md @@ -1471,43 +1471,43 @@ invalid timezone "xxx", please see the file "$GOROOT/lib/time/zoneinfo.zip" for ##### Format sign table -| sign | desc | length | range | example | -| :------------: |:--------------------------------------------------------------------------------------------------------:|:------:|:----------------:|:-------------------------------:| -| d | Day of the month, padded to 2 | 2 | 01-31 | 02 | -| D | Day of the week, as an abbreviate localized string | 3 | Mon-Sun | Mon | -| j | Day of the month, no padding | - | 1-31 | 2 | -| S | English ordinal suffix for the day of the month, 2 characters. Eg: st, nd, rd or th. Works well with j | 2 | st/nd/rd/th | th | -| l | Day of the week, as an unabbreviated localized string | - | Monday-Sunday | Monday | -| F | Month as an unabbreviated localized string | - | January-December | January | -| m | Month, padded to 2 | 2 | 01-12 | 01 | -| M | Month as an abbreviated localized string | 3 | Jan-Dec | Jan | -| n | Month, no padding | - | 1-12 | 1 | -| Y | Four-digit year | 4 | 0000-9999 | 2006 | -| y | Two-digit year | 2 | 00-99 | 06 | -| a | Lowercase morning or afternoon sign | 2 | am/pm | pm | -| A | Uppercase morning or afternoon sign | 2 | AM/PM | PM | -| g | Hour in 12-hour format, no padding | - | 1-12 | 3 | -| G | Hour in 24-hour format, no padding | - | 0-23 | 15 | -| h | Hour in 12-hour format, padded to 2 | 2 | 00-11 | 03 | -| 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 | -| W | ISO8601 week of the year | 2 | 01-52 | 01 | -| N | ISO8601 day of the week | 2 | 01-07 | 02 | -| L | Whether it's a leap year | 1 | 0-1 | 0 | -| U | Unix timestamp with seconds | 10 | - | 1611818268 | -| u | Millisecond | - | 1-999 | 999 | -| w | Day of the week | 1 | 0-6 | 1 | -| t | Total days of the month | 2 | 28-31 | 31 | -| z | Day of the year | - | 1-365 | 2 | -| e | Location | - | - | America/New_York | -| Q | Quarter | 1 | 1-4 | 1 | -| C | Century | - | 0-99 | 21 | +| sign | desc | length | range | example | +| :------------: |:------------------------------------------------------------------------------------------------------------------:|:------:|:----------------:|:-------------------------------:| +| d | Day of the month, padded to 2 | 2 | 01-31 | 02 | +| D | Day of the week, as an abbreviate localized string | 3 | Mon-Sun | Mon | +| j | Day of the month, no padding | - | 1-31 | 2 | +| S | English ordinal suffix for the day of the month, 2 characters. Eg: st, nd, rd or th. Works well with j | 2 | st/nd/rd/th | th | +| l | Day of the week, as an unabbreviated localized string | - | Monday-Sunday | Monday | +| F | Month as an unabbreviated localized string | - | January-December | January | +| m | Month, padded to 2 | 2 | 01-12 | 01 | +| M | Month as an abbreviated localized string | 3 | Jan-Dec | Jan | +| n | Month, no padding | - | 1-12 | 1 | +| Y | Four-digit year | 4 | 0000-9999 | 2006 | +| y | Two-digit year | 2 | 00-99 | 06 | +| a | Lowercase morning or afternoon sign | 2 | am/pm | pm | +| A | Uppercase morning or afternoon sign | 2 | AM/PM | PM | +| g | Hour in 12-hour format, no padding | - | 1-12 | 3 | +| G | Hour in 24-hour format, no padding | - | 0-23 | 15 | +| h | Hour in 12-hour format, padded to 2 | 2 | 00-11 | 03 | +| 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 | +| W | week of the year, padded to 2 | 2 | 01-52 | 01 | +| N | day of the week, padded to 2 | 2 | 01-07 | 02 | +| L | Whether it's a leap year | 1 | 0-1 | 0 | +| U | Unix timestamp with seconds | 10 | - | 1611818268 | +| u | Millisecond | - | 1-999 | 999 | +| w | Day of the week | 1 | 0-6 | 1 | +| t | Total days of the month | 2 | 28-31 | 31 | +| z | Day of the year | - | 1-365 | 2 | +| e | Location | - | - | America/New_York | +| Q | Quarter | 1 | 1-4 | 1 | +| C | Century | - | 0-99 | 21 | #### FAQ