Leave a comment

andrewducker March 30 2016, 11:01:19 UTC
Slight overlap there, as I moved the posting time from 1pm to midday.

(I'll try and fix that for the next time the clocks change)

Reply

momentsmusicaux March 30 2016, 12:10:07 UTC
Ah, so are you now posting as the same local time for you throughout the year, rather than the same UTC time?

Reply

andrewducker March 30 2016, 22:00:12 UTC
It is posting on UTC. I had to do a manual adjustment to get it to post at midday.

Hopefully, by the time the clocks go back again I'll have fixed that.

Reply

momentsmusicaux March 30 2016, 22:08:58 UTC
Ah you've confused me now...

The script wants to post at the same UTC time all year round, but this time you've tweaked it manually so that for people in the UK*, it's staying at the same local time? And in 6 months' time you hope to have it adjust itself every times the clocks change?

* And everywhere else where the DST change happens on the same day. Which might not be everywhere. For a time when I was a kid there was a 2 week period in the autumn when France and the UK were on the same time, because they changed DST two weeks apart.

Reply

andrewducker March 30 2016, 22:21:45 UTC
Yeah, the dates/times are stored in UTC internally, so adding on a day adds on a UTC day.

But I adjusted the next-posting-time manually to be noon.

And I hope that in 6 months time, when the clocks change, I'll have updated the code so that it will do the conversion to local time, add one day, and then convert back to UTC.

Reply

momentsmusicaux March 30 2016, 22:48:30 UTC
I seem to remember you're doing this in a language that has fairly crappy time and date handling...

In PHP that would be so easy. There's actually a function which takes a parameter of the form "+ 1 day" and does the Right Thing (TM).

Reply

andrewducker March 30 2016, 22:49:47 UTC
Yeah, the code I'm using has the same thing.

I just have to read in the user's preference for their timezone, do the conversion from UTC to the timezone, add a day, convert back to UTC, and save it.

Probably about five lines of code.

Reply


Leave a comment

Up