Created
August 2, 2021 06:49
-
-
Save wewindy/9f50f6722dc62ea82e5d9ce4b94fec06 to your computer and use it in GitHub Desktop.
A simple custom moment format demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import moment from 'moment' | |
| moment(`2010/1/1 19:20:59.990`, 'YYYY/M/D HH:mm:ss.SSS') | |
| // 解析到的月份是0开头的 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
年份字母是
Y,YYYY代表解析4个数字的年份月份字母是
M,M代表解析1个数字,MM代表解析两个数字的月份以此类推,查文档即可。