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

Timezone database error (Europe/Budapest) #3788

Closed
fzoli opened this issue Feb 26, 2017 · 2 comments
Closed

Timezone database error (Europe/Budapest) #3788

fzoli opened this issue Feb 26, 2017 · 2 comments

Comments

@fzoli
Copy link

fzoli commented Feb 26, 2017

Description of the Issue and Steps to Reproduce:

I think I have just found a timezone database parse(?) error.

moment.tz("1890-01-01 00:00", "Europe/Paris").format()
// "1890-01-01T00:00:00+00:09" // OK

moment.tz("1890-01-01 00:00", "Europe/Bucharest").format()
// "1890-01-01T00:00:00+01:44" // OK

moment.tz("1890-01-01 00:00", "Europe/Budapest").format()
// "1890-01-01T00:00:00+01:00" // WRONG
// It should be "1890-01-01T00:00:00+01:16:20" (or at least +01:16)

From the tzdb-2016j:

Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
Zone	Europe/Budapest	1:16:20 -	LMT	1890 Oct

Environment:
Chrome 55 on Ubuntu 14.04.5 LTS
System timezone: Europe/Budapest

console.log( (new Date()).toString()) // Sun Feb 26 2017 11:19:46 GMT+0100 (CET)
console.log((new Date()).toLocaleString()) // 2017. 02. 26. 11:19:46
console.log( (new Date()).getTimezoneOffset()) // -60
console.log( navigator.userAgent) // Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
console.log(moment.version) // 2.17.1
@fzoli
Copy link
Author

fzoli commented Feb 26, 2017

Another note:

moment.tz('1890-01-01T00:00:00Z', 'Europe/Paris').format()
// "1890-01-01T00:09:21+00:09"

Should not the offset be "+00:09:21"?

moment.tz('1890-01-01T00:09:21+00:09', 'Europe/Paris').format()
// "1890-01-01T00:09:42+00:09" // DateTime differs of course

I can live with this. I just send the date in UTC to the server:

moment.tz('1890-01-01 00:09:21', 'Europe/Paris').clone().tz('UTC').format()
// "1890-01-01T00:00:00Z"

The original issue should be fixed:

moment.tz('1890-01-01 01:16:20', 'Europe/Budapest').clone().tz('UTC').format()
// "1890-01-01T00:16:20Z" // should be: "1890-01-01T00:00:00Z"

@fzoli
Copy link
Author

fzoli commented Feb 26, 2017

I posted the issue into the wrong repository.
I clone the issue into the correct place and close this.
See: moment/moment-timezone#450

@fzoli fzoli closed this as completed Feb 26, 2017
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