-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Description
Any negative unix value is failed to be correctly parsed
> var parseUnix = d3.timeParse("%Q")
> parseUnix(978325200000).toString()
"Mon Jan 01 2001 00:00:00 GMT-0500 (Eastern Standard Time)"
> parseUnix(0).toString()
"Wed Dec 31 1969 19:00:00 GMT-0500 (Eastern Standard Time)"
> parseUnix(-1)
nullNote that formatting dates prior to epoch, returns negative values
> var formatUnix = d3.timeFormat("%Q");
> formatUnix(new Date(-1))
-1
> var parseUnix = d3.timeParse("%Q")
> parseUnix(formatUnix(new Date(-1)))
nullAs you may have noticed that the native JS Date constructor is able to parse negative Unix time, so not a huge problem for basic tasks, but support for parsing negative values may be needed in more complex tasks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels