gr2m / moment-parseformat

A moment.js plugin to extract the format of a date/time string
http://gr2m.github.io/moment-parseformat
Apache License 2.0
45 stars 30 forks source link

2016-07-20 16:33:58+0000 → YYYY-MM-DD H:mm:ss YYYY #53

Closed eburlaka closed 8 years ago

eburlaka commented 8 years ago

moment.parseFormat('2016-07-20 16:33:58+0000') parsed to YYYY-MM-DD H:mm:ss YYYY, I expected: YYYY-MM-DD H:mm:ss+0000

gr2m commented 8 years ago

moment.parseFormat is meant to help parsing dates from user input. 2016-07-20 16:33:58+0000 looks more like a timestamp, you can pass it directly to new Date('2016-07-20 16:33:58+0000') or moment('2016-07-20 16:33:58+0000').format('MMMM Do YYYY, h:mm:ss a'). Does that work for you?