4.6.201909200944 • Published 6 years ago
@dfeidao/fd-an000054 v4.6.201909200944
获取一天的开始时间
Installation
yarn add --dev @dfeidao/fd-an000054时间格式
| 单位 | 格式 | 示例 |
|---|---|---|
| 公元 | G..GGG | AD, BC |
| GGGG | Anno Domini, Before Christ | |
| GGGGG | A, B | |
| 年 | y | 44, 1, 1900, 2017 |
| yo | 44th, 1st, 0th, 17th | |
| yy | 44, 01, 00, 17 | |
| yyy | 044, 001, 1900, 2017 | |
| yyyy | 0044, 0001, 1900, 2017 | |
| yyyyy | ... | |
| Local week-numbering year | Y | 44, 1, 1900, 2017 |
| Yo | 44th, 1st, 1900th, 2017th | |
| YY | 44, 01, 00, 17 | |
| YYY | 044, 001, 1900, 2017 | |
| YYYY | 0044, 0001, 1900, 2017 | |
| YYYYY | ... | |
| ISO week-numbering year | R | -43, 0, 1, 1900, 2017 |
| RR | -43, 00, 01, 1900, 2017 | |
| RRR | -043, 000, 001, 1900, 2017 | |
| RRRR | -0043, 0000, 0001, 1900, 2017 | |
| RRRRR | ... | |
| Extended year | u | -43, 0, 1, 1900, 2017 |
| uu | -43, 01, 1900, 2017 | |
| uuu | -043, 001, 1900, 2017 | |
| uuuu | -0043, 0001, 1900, 2017 | |
| uuuuu | ... | |
| 刻 | Q | 1, 2, 3, 4 |
| Qo | 1st, 2nd, 3rd, 4th | |
| 01, 02, 03, 04 | ||
| QQQ | Q1, Q2, Q3, Q4 | |
| QQQQ | 1st quarter, 2nd quarter, ... | |
| QQQQQ | 1, 2, 3, 4 | |
| Quarter (stand-alone) | q | 1, 2, 3, 4 |
| qo | 1st, 2nd, 3rd, 4th | |
| 01, 02, 03, 04 | ||
| qqq | Q1, Q2, Q3, Q4 | |
| qqqq | 1st quarter, 2nd quarter, ... | |
| qqqqq | 1, 2, 3, 4 | |
| 月 | M | 1, 2, ..., 12 |
| Mo | 1st, 2nd, ..., 12th | |
| MM | 01, 02, ..., 12 | |
| MMM | Jan, Feb, ..., Dec | |
| MMMM | January, February, ..., December | |
| MMMMM | J, F, ..., D | |
| Month (stand-alone) | L | 1, 2, ..., 12 |
| Lo | 1st, 2nd, ..., 12th | |
| LL | 01, 02, ..., 12 | |
| LLL | Jan, Feb, ..., Dec | |
| LLLL | January, February, ..., December | |
| LLLLL | J, F, ..., D | |
| 一年中的第几周 | w | 1, 2, ..., 53 |
| wo | 1st, 2nd, ..., 53th | |
| ww | 01, 02, ..., 53 | |
| ISO week of year | I | 1, 2, ..., 53 |
| Io | 1st, 2nd, ..., 53th | |
| II | 01, 02, ..., 53 | |
| 一月中的第几天 | d | 1, 2, ..., 31 |
| do | 1st, 2nd, ..., 31st | |
| dd | 01, 02, ..., 31 | |
| 一年中的第几天 | D | 1, 2, ..., 365, 366 |
| Do | 1st, 2nd, ..., 365th, 366th | |
| DD | 01, 02, ..., 365, 366 | |
| DDD | 001, 002, ..., 365, 366 | |
| DDDD | ... | |
| Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Su |
| EEEE | Monday, Tuesday, ..., Sunday | |
| EEEEE | M, T, W, T, F, S, S | |
| EEEEEE | Mo, Tu, We, Th, Fr, Su, Sa | |
| ISO day of week (formatting) | i | 1, 2, 3, ..., 7 |
| io | 1st, 2nd, ..., 7th | |
| ii | 01, 02, ..., 07 | |
| iii | Mon, Tue, Wed, ..., Su | |
| iiii | Monday, Tuesday, ..., Sunday | |
| iiiii | M, T, W, T, F, S, S | |
| iiiiii | Mo, Tu, We, Th, Fr, Su, Sa | |
| 一周中的第几天 | e | 2, 3, 4, ..., 1 |
| eo | 2nd, 3rd, ..., 1st | |
| ee | 02, 03, ..., 01 | |
| eee | Mon, Tue, Wed, ..., Su | |
| eeee | Monday, Tuesday, ..., Sunday | |
| eeeee | M, T, W, T, F, S, S | |
| eeeeee | Mo, Tu, We, Th, Fr, Su, Sa | |
| Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 |
| co | 2nd, 3rd, ..., 1st | |
| cc | 02, 03, ..., 01 | |
| ccc | Mon, Tue, Wed, ..., Su | |
| cccc | Monday, Tuesday, ..., Sunday | |
| ccccc | M, T, W, T, F, S, S | |
| cccccc | Mo, Tu, We, Th, Fr, Su, Sa | |
| 上午, 下午 | a..aaa | AM, PM |
| aaaa | a.m., p.m. | |
| aaaaa | a, p | |
| 上午, 下午, 中午, 子夜 | b..bbb | AM, PM, noon, midnight |
| bbbb | a.m., p.m., noon, midnight | |
| bbbbb | a, p, n, mi | |
| Flexible day period | B..BBB | at night, in the morning, ... |
| BBBB | at night, in the morning, ... | |
| BBBBB | at night, in the morning, ... | |
| 小时 1-12 | h | 1, 2, ..., 11, 12 |
| ho | 1st, 2nd, ..., 11th, 12th | |
| hh | 01, 02, ..., 11, 12 | |
| 小时 0-23 | H | 0, 1, 2, ..., 23 |
| Ho | 0th, 1st, 2nd, ..., 23rd | |
| HH | 00, 01, 02, ..., 23 | |
| 小时 0-11 | K | 1, 2, ..., 11, 0 |
| Ko | 1st, 2nd, ..., 11th, 0th | |
| KK | 1, 2, ..., 11, 0 | |
| 小时 1-24 | k | 24, 1, 2, ..., 23 |
| ko | 24th, 1st, 2nd, ..., 23rd | |
| kk | 24, 01, 02, ..., 23 | |
| 分钟 | m | 0, 1, ..., 59 |
| mo | 0th, 1st, ..., 59th | |
| mm | 00, 01, ..., 59 | |
| 秒 | s | 0, 1, ..., 59 |
| so | 0th, 1st, ..., 59th | |
| ss | 00, 01, ..., 59 | |
| Fraction of second | S | 0, 1, ..., 9 |
| SS | 00, 01, ..., 99 | |
| SSS | 000, 0001, ..., 999 | |
| SSSS | ... | |
| 时区 (ISO-8601 w/ Z) | X | -08, +0530, Z |
| XX | -0800, +0530, Z | |
| XXX | -08:00, +05:30, Z | |
| XXXX | -0800, +0530, Z, +123456 | |
| XXXXX | -08:00, +05:30, Z, +12:34:56 | |
| 时区 (ISO-8601 w/o Z) | x | -08, +0530, +00 |
| xx | -0800, +0530, +0000 | |
| xxx | -08:00, +05:30, +00:00 | |
| xxxx | -0800, +0530, +0000, +123456 | |
| xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
| 时区 (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 |
| OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | |
| 时区 (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 |
| zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | |
| 以秒为单位的时间戳 | t | 512969520 |
| tt | ... | |
| 以毫秒为单位的时间戳 | T | 512969520900 |
| TT | ... | |
| Long localized date | P | 5/29/53 |
| PP | May 29, 1453 | |
| PPP | May 29th, 1453 | |
| PPPP | Sunday, May 29th, 1453 | |
| Long localized time | p | 12:00 AM |
| pp | 12:00:00 AM | |
| ppp | 12:00:00 AM GMT+2 | |
| pppp | 12:00:00 AM GMT+02:00 | |
| Combination of date and time | Pp | 5/29/53, 12:00 AM |
| PPpp | May 29, 1453, 12:00 AM | |
| PPPppp | May 29th, 1453 at ... | |
| PPPPpppp | Sunday, May 29th, 1453 at ... |
Example
import an54 from '@dfeidao/fd-an000054';
const now_date = new Date().getTime(); // 1551168254155
const new_date = an54(now_date); // 15511104000004.6.201909200944
6 years ago
4.6.201909191022
6 years ago
4.6.201909191015
6 years ago
4.6.201909181736
6 years ago
4.6.201909181732
6 years ago
4.6.201909181659
6 years ago