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

Add ability to format with a specific timezone #13

Open
dietergeerts opened this issue Jan 27, 2022 · 1 comment
Open

Add ability to format with a specific timezone #13

dietergeerts opened this issue Jan 27, 2022 · 1 comment

Comments

@dietergeerts
Copy link

Hi, we are looking for a simple formatting library to format dates and times in templates on the server, but using the timezone the clients sends us. I can't seem to find settings for timezone in this library, so are they missing, or isn't it documented, or maybe I'm looking over it? If this is missing, it would be nice if this can be added.

@talaikis
Copy link

Hi, we are looking for a simple formatting library to format dates and times in templates on the server, but using the

Just reparse the date with locale:

const out = new Date(date.toLocaleString('en', { timeZone: 'you timezone' }))
format(out, '....')

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

2 participants