Time

Time is a complicated beast. An hour can last 3600 seconds or 3599 seconds, if there's a leap second. Tomorrow can be 23 to 25 hours away, months range from 28 to 31 days, and a year can be 365 or 366 days. Some decades have fewer days than others.

Keep this in mind next time you want to add 3,600 seconds to a timestamp to advance it by an hour, or add 24*3600 to a timestamp to get the same time one day into the future.

Considering that many datasets are closely tied to time, this can become a big problem. Just how do you handle time?

Luckily, D3 comes with a bunch of time-handling features. They're all located in the d3-time-format package.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset