Skip to content

Parse custom date move from moment to luxon #1407

Answered by diesieben07
axi92 asked this question in Q&A
Discussion options

You must be logged in to vote

d MMM, yyyy @ hh:mma cannot parse 13 Sep, 2015 @ 6:52pm, because hh and mm are padded tokens. That means the format expects exactly two digits. Your input strings use unpadded numbers, so you should use h and m.

d MMM @ h:ma can be used to parse your 1st example.
d MMM, yyyy @ h:ma can be used to parse your 2nd example.

Please let me know if this solves your issue!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@axi92
Comment options

Answer selected by axi92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants