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

Date.UTC() doesn't interpret two-digit years correctly #220

Closed
kpreisser opened this issue Sep 20, 2022 · 1 comment
Closed

Date.UTC() doesn't interpret two-digit years correctly #220

kpreisser opened this issue Sep 20, 2022 · 1 comment

Comments

@kpreisser
Copy link
Collaborator

kpreisser commented Sep 20, 2022

According to the ES5.1 and ES2015 spec, Date.UTC(year, month, ...) should add 1900 to year when 0 ≤ year ≤ 99, but Jurassic (tested with commit a22ef7c) currently interprets it as full year (whereas for the new Date(...) constructor, the behavior is correct).

Expected behavior:

console.log(Date.UTC(70, 0)); // Should print "0"

Actual behavior:

console.log(Date.UTC(70, 0)); // Prints "-59958144000000"

Thanks!

@paulbartrum
Copy link
Owner

paulbartrum commented Sep 20, 2022

Thanks for the bug report, I've done a fix :-)

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