Open VladimirMilenko opened 4 years ago
This is due to a failing RegEx match, not verifying the time zone value itself. I'm pretty sure, at least as far as I can recall, that "2019-11-20T22:59Z Etc/UTC"
should work fine. (The time zone is redundant here, since the Z
is sufficient to indicate UTC time. I'm assuming you might also provide different time zones; if that's not the case just omit it.) It looks like the RegEx in question is including Z[
in the value under consideration and then fails.
I'm not sure when I would get around to looking into this, so if you can sort this out with tests in a PR in the meantime I'd be happy to review and merge if it's worth your while.
When trying to call
dateFnsTz.toDate("2019-11-20T22:59Z[Etc/UTC]")
we get an exception:However,
Etc/UTC
is a valid IANA zone