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

parsing time zone offset with second fails #772

Open
palindrom615 opened this issue Jul 24, 2019 · 4 comments
Labels
bug

Comments

@palindrom615
Copy link

@palindrom615 palindrom615 commented Jul 24, 2019

moment("1899-06-28T23:27:52.000+08:27:52") // invalid date!

Above code results Invalid Date because moment cannot parse timezone offset with the second part.

Though the format is not standard, it is valid Korean standard time before GMT is adopted in Korea on April 1st, 1908. (see this: https://ko.wikipedia.org/wiki/%ED%95%9C%EA%B5%AD_%ED%91%9C%EC%A4%80%EC%8B%9C) Can this case be considered? This bug affects business logic on my work.

@saschanaz

This comment has been minimized.

Copy link

@saschanaz saschanaz commented Jul 25, 2019

The document only says it was +08:28, not +08:27:52 though...

@palindrom615

This comment has been minimized.

Copy link
Author

@palindrom615 palindrom615 commented Jul 25, 2019

@saschanaz ,

The document only says it was +08:28, not +08:27:52 though...

Yeah, Wikipedia does not mention about the second unit of offset. The premodern time standard is quite an ambiguous problem, but implementations like java ZonedDateTime are designed with later one:
1-934-0f55c3

@saschanaz

This comment has been minimized.

Copy link

@saschanaz saschanaz commented Jul 25, 2019

The Intl implementation in Firefox also generates +08:27:52:

> Intl.DateTimeFormat("default", { timeZone: "Asia/Seoul", timeZoneName: "long" }).format(new Date("1900-01-01T00:00:00"))
"1/1/1900, GMT+08:27:52"
@Hoto-Cocoa

This comment has been minimized.

Copy link

@Hoto-Cocoa Hoto-Cocoa commented Jul 25, 2019

According Wikipedia's Time in North Korea Document, "Hanyang (Seoul) which was calculated to be UTC+08:27:52[Ref: A Bridge between Conceptual Frameworks: Sciences, Society and Technology Studies edited by Raffaele Pisano]. In 1442".

image

@ellenaua ellenaua added the bug label Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.