date-fns-timezone
date-fns-timezone copied to clipboard
Z character not escaped when put in square brackets
Let say I have some date in a variable called dateObject (1 July 2019 05:00:00 UTC), then doing:
formatToTimeZone(dateObject, 'DDHHmm[Z] MMM YYYY', { timeZone: 'UTC' })
should give:
010500Z Jul 2019
but instead gives:
010500+00:00 Jul 2019
I thought doing [Z] escapes the Z like the M in [GMT]????
I have the same problem and it's really annoying 😥
That's my use case too, however it seems Z is indeed not escaped...
Also, note that date-fns now uses ' for escaping characters
Edit: Ended up using: https://www.npmjs.com/package/date-fns-tz