# JavaScript Date to represent intervals?

**URL:** <https://forum.freecodecamp.org/t/javascript-date-to-represent-intervals/448856>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [February 28, 2021, 6:47am UTC](https://forum.freecodecamp.org/t/javascript-date-to-represent-intervals/448856 "2021-02-28T06:47:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edfcf](https://avatars.discourse-cdn.com/v4/letter/e/f0a364/32.png) [@edfcf](https://forum.freecodecamp.org/u/edfcf)\
**Post date:** [February 28, 2021, 6:47am UTC](https://forum.freecodecamp.org/t/javascript-date-to-represent-intervals/448856/1 "2021-02-28T06:47:56Z")

</div>

Hi everyone.

[D3 Data Visualization project 2 “Scatterplot”](https://www.freecodecamp.org/learn/data-visualization/data-visualization-projects/visualize-data-with-a-scatterplot-graph) user story #6 requires representing time intervals using Date objects.

While this works for the specific case (where intervals are lower than one hour) it might have issues with intervals longer than 60 minutes, because local time zones would represent hours differently. See [this link](https://stackoverflow.com/questions/24541296/d3-js-time-scale-nicely-spaced-ticks-at-minute-intervals-when-data-is-in-second#answer-24544067) (paragraph “option 2”) for a longer explanation.

[This post](https://forum.freecodecamp.org/t/d3-scatterplot-graph/227473/4) contains the core solution to the challenge but I believe it does not completely eliminate the issue with locale time zones.

Please what are your thoughts on this matter?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [August 29, 2021, 6:48pm UTC](https://forum.freecodecamp.org/t/javascript-date-to-represent-intervals/448856/2 "2021-08-29T18:48:04Z")

</div>

Closed on August 29, 2021, 6:48pm UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
