You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parsing date using timezone returns different output if used with and without date format.
Current result:
moment.tz("18 Oct 2019, 15:40:42","Europe/London").valueOf()1571413242000moment.tz("18 Oct 2019, 15:40:42","DD MMM YYYY, hh:mm:ss","Europe/London").valueOf()1571409642000
Expected result:
moment.tz("18 Oct 2019, 15:40:42","Europe/London").valueOf()1571409642000moment.tz("18 Oct 2019, 15:40:42","DD MMM YYYY, hh:mm:ss","Europe/London").valueOf()1571409642000
This does not look like expected behaviour.
Result of converting date based on timezone should not be dependent on date formatting.
The text was updated successfully, but these errors were encountered:
This is not an issue, just don't assume your format is handled by moment, because it will silently be passed on to Date and all bets are off. There is a reason moment constructor outputs warnings if that happens. We should just introduce new constructors which disable this behavior (passing to Date and hoping for the best).
TLDR -- if you KNOW the format, pass it. If you don't know the format, don't get upset when it's not parsed correctly. Every single country has it's own standards and rituals of writing dates, moment (and Date) can't possibly know what you mean.
Parsing date using timezone returns different output if used with and without date format.
Current result:
Expected result:
This does not look like expected behaviour.
Result of converting date based on timezone should not be dependent on date formatting.
The text was updated successfully, but these errors were encountered: