Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Z character not escaped when put in square brackets #12

Open
d4sh opened this issue Jul 8, 2019 · 2 comments
Open

Z character not escaped when put in square brackets #12

d4sh opened this issue Jul 8, 2019 · 2 comments

Comments

@d4sh
Copy link

d4sh commented Jul 8, 2019

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]????

@MichalLytek
Copy link

I have the same problem and it's really annoying 😥

@TimDaub
Copy link

TimDaub commented Oct 12, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants