JavaScript Date to represent intervals?

Hi everyone.

D3 Data Visualization project 2 “Scatterplot” 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 (paragraph “option 2”) for a longer explanation.

This post 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?