[quickjs-devel] Bug report: incorrect handling of fractions of seconds in dates parse

  • From: Alexander Rodin <rodin.alexander@xxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Tue, 6 Aug 2019 00:24:45 +0300

In quickjs-2019-07-28 fractions of the seconds in ISO dates are not parsed 
correctly when number of digits after the point is not equal to three:

qjs > new Date("2020-01-01T01:01:01.1Z").toISOString()
"2020-01-01T01:01:01.001Z”

qjs > new Date("2020-01-01T01:01:01.12Z").toISOString()
"2020-01-01T01:01:01.012Z”

qjs > new Date("2020-01-01T01:01:01.123Z").toISOString()
"2020-01-01T01:01:01.123Z”

qjs > new Date("2020-01-01T01:01:01.1234Z").toISOString()
"2020-01-01T01:01:02.234Z”

qjs > new Date("2020-01-01T01:01:01.12345Z").toISOString()
"2020-01-01T01:01:13.345Z”

Thanks,
Alexander

Other related posts: