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

format("z") seems to have issues with timezones #36

Open
rejhgadellaa opened this issue Aug 18, 2018 · 1 comment
Open

format("z") seems to have issues with timezones #36

rejhgadellaa opened this issue Aug 18, 2018 · 1 comment

Comments

@rejhgadellaa
Copy link

rejhgadellaa commented Aug 18, 2018

In Chrome's console:

new Date(1534545439635);
Sat Aug 18 2018 00:37:19 GMT+0200 (Central European Summer Time)

new Date(1534545439635).format("z");
"229"

The same day but later:

new Date(1534588427903)
Sat Aug 18 2018 12:33:47 GMT+0200 (Central European Summer Time)

new Date(1534588427903).format("z");
"230"

The timestamp at 00:37:19 returns "229" but the timestamp of the same day at 12:33:47 returns "230"

Note: Central European Summer Time is GMT +02:00 ;)

@rejhgadellaa
Copy link
Author

After a quick google I think I found a solution that seems to work on SO:
https://stackoverflow.com/a/26426761/781094

I've hacked it in your dateformat library and the results are promising ;)

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

1 participant