I am trying to output a series of times in hour (on the hour) intervals within Javascript (so inside a web browser such as Firefox). This series of times will overlap the short day (losing an hour in spring) and long day (gaining an hour in autumn). The output I'm looking for is in local time, i.e. with timezone and DST offsets applied. So for example, in the UK we have a missing hour from 01:00 to 01:59 on the short day such that the output would be:
00:00, 02:00, 03:00
And on the long day we have an extra hour from 01:00 to 02:00 such that the output would be:
00:00, 01:00, 01:00, 02:00, 03:00
I have already found these two brilliant answers that highlight some pitfalls and address part of my problem:
But the real difficulty is in making javascript aware of this missing and extra hour (so to speak) as identified in the second question mentioned above.
I think a potential solution to this would be to operate in UTC (aka GMT) and just do a conversion to local time but I'm struggling to see how I could do this.
Does anyone have any ideas about how to achive what I'm after?