moment.js & UTC Time


WEB Site:  https://momentjs.com/docs/

1. Local to UTC moment(LocalTime).utc()
moment.utc(...) is utc mode. Ambiguous input is assumed to be UTC. Unambiguous input is adjusted to UTC.
2. UTC to Local  moment.utc(value).local().format('YYYY-MM-DD HH:mm:ss:SSS')

3. Now   moment().format('YYYY-MM-DDTHH:mm:ss:SSS');

1.Local to UTC: moment.parseZone(DateTimePaidLocal).utc().format()
moment.parseZone() keep the input zone passed in. If the input is ambiguous, it is the same as local mode.
2.UTC to Local: return moment.parseZone(DateTimePaidUtc).format()

"moment": {       "version""2.24.0",       "resolved""https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", "integrity" "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/ 0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==" }
import moment from 'moment'

评论

  1. Do this hack to drop 2lb of fat in 8 hours

    At least 160000 men and women are hacking their diet with a simple and secret "water hack" to drop 1-2 lbs each night while they sleep.

    It is painless and works all the time.

    Here are the easy steps for this hack:

    1) Take a clear glass and fill it with water half glass

    2) Then do this proven HACK

    and you'll be 1-2 lbs skinnier when you wake up!

    回复删除

发表评论

此博客中的热门博文

XML, XSL, HTML

Input in element.eleme.io

Data URI是由RFC 2397 ACE