Closed kpreisser closed 1 year ago
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 https://github.com/paulbartrum/jurassic/commit/a22ef7ca7c47f156282f19d2c1180f8a3701ab6a) currently interprets it as full year (whereas for the new Date(...) constructor, the behavior is correct).
Date.UTC(year, month, ...)
year
new Date(...)
Expected behavior:
console.log(Date.UTC(70, 0)); // Should print "0"
Actual behavior:
console.log(Date.UTC(70, 0)); // Prints "-59958144000000"
Thanks!
Thanks for the bug report, I've done a fix :-)
According to the ES5.1 and ES2015 spec,
Date.UTC(year, month, ...)
should add 1900 toyear
when 0 ≤year
≤ 99, but Jurassic (tested with commit https://github.com/paulbartrum/jurassic/commit/a22ef7ca7c47f156282f19d2c1180f8a3701ab6a) currently interprets it as full year (whereas for thenew Date(...)
constructor, the behavior is correct).Expected behavior:
Actual behavior:
Thanks!