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

"2014-02-02T10:11:58+00:00" => YYYY-MM-DDTH:mm:ss+H:mm #5

Closed danroberts closed 10 years ago

danroberts commented 10 years ago

moment itself parses this correctly as YYYY-MM-DDTH:mm:ss Z

gr2m commented 10 years ago

I'm curious, what would be a use case for that? I currently use it exclusively to parse human inputs. That's a timestamp format that'd be rather used internally, but not put in by a human manually, would it?

danroberts commented 10 years ago

If the purpose of the library is purely to interpret human input dates, fair enough. I am using it to interpret dates from unknown sources in unknown formats, both human and computer readable.

This use case involves accepting dates from any possible sources, in this case, it is the date format of a Google Survey.

gr2m commented 10 years ago

Could you farther explain why you'd need to parse date formats for data coming from external resources? Why isn't parsing the actual date/times enough? You might have a great use case, I just don't see it yet