Rev | Line | |
---|
[76] | 1 | require("./../../lib/env-js/envjs/node"); |
---|
| 2 | require("./../../d3"); |
---|
| 3 | require("./../../d3.time"); |
---|
| 4 | |
---|
| 5 | function parse(string) { return new Date(string); } |
---|
| 6 | function format(date) { return date.toString(); } |
---|
| 7 | |
---|
| 8 | console.log("second:"); |
---|
| 9 | console.log(" 2010-12-31T23:59:59.999Z -> " + format(d3.time.second(parse("2010-12-31T23:59:59.999Z")))); |
---|
| 10 | console.log(" 2011-01-01T00:00:00.000Z -> " + format(d3.time.second(parse("2011-01-01T00:00:00.000Z")))); |
---|
| 11 | console.log(" 2011-01-01T00:00:00.456Z -> " + format(d3.time.second(parse("2011-01-01T00:00:00.456Z")))); |
---|
| 12 | console.log(" 2011-01-01T00:00:00.999Z -> " + format(d3.time.second(parse("2011-01-01T00:00:00.999Z")))); |
---|
| 13 | console.log(" 2011-01-01T00:00:59.999Z -> " + format(d3.time.second(parse("2011-01-01T00:00:59.999Z")))); |
---|
| 14 | console.log(""); |
---|
| 15 | |
---|
| 16 | console.log("second.utc:"); |
---|
| 17 | console.log(" 2010-12-31T23:59:59.999Z -> " + format(d3.time.second.utc(parse("2010-12-31T23:59:59.999Z")))); |
---|
| 18 | console.log(" 2011-01-01T00:00:00.000Z -> " + format(d3.time.second.utc(parse("2011-01-01T00:00:00.000Z")))); |
---|
| 19 | console.log(" 2011-01-01T00:00:00.456Z -> " + format(d3.time.second.utc(parse("2011-01-01T00:00:00.456Z")))); |
---|
| 20 | console.log(" 2011-01-01T00:00:00.999Z -> " + format(d3.time.second.utc(parse("2011-01-01T00:00:00.999Z")))); |
---|
| 21 | console.log(" 2011-01-01T00:00:59.999Z -> " + format(d3.time.second.utc(parse("2011-01-01T00:00:59.999Z")))); |
---|
| 22 | console.log(""); |
---|
Note: See
TracBrowser
for help on using the repository browser.