JSON.stringify(Date) loses the milliseconds information
[WebKit-https.git] / LayoutTests / fast / js / resources / date-toisostring.js
1 description("Tests for Date.toISOString");
2
3 shouldThrow("Date.toISOString.call({})");
4 shouldThrow("Date.toISOString.call(0)");
5
6 shouldBe("new Date(0).toISOString()", "'1970-01-01T00:00:00.000Z'");
7 shouldBe("new Date('1 January 1500 UTC').toISOString()", "'1500-01-01T00:00:00.000Z'");
8 shouldBe("new Date('1 January 2000 UTC').toISOString()", "'2000-01-01T00:00:00.000Z'");
9 shouldBe("new Date('1 January 4000 UTC').toISOString()", "'4000-01-01T00:00:00.000Z'");
10 shouldBe("new Date('1 January 100000 UTC').toISOString()", "'100000-01-01T00:00:00.000Z'");
11 shouldBe("new Date('10 March 2000 UTC').toISOString()", "'2000-03-10T00:00:00.000Z'");
12 shouldBe("new Date(NaN).toISOString()", "'Invalid Date'");
13
14 successfullyParsed = true;