Andrew Ducker (andrewducker) wrote,
Andrew Ducker
andrewducker

More questions about dates, timezones, etc.

I have two, separate, issues with the feed poster I'm currently writing and timezones.

1) I have to make sure that any posts that I make to DW/LJ are made with the correct timestamp on them - if you attempt to make a post that has a timestamp before an existing post then the server returns an error. I've dealt with this in the past by taking the current server time, converting to the timezone the user has set, and sending that. So if you're in the USA, with a timezone set to UTC-8, then a post sent at midday UTC will be sent as 4:00:00. I can continue to do this with my new poster.

2) At the moment the posting times are all set in UTC - so if I say "post at midday" that means "midday in the UK, ignoring daylight saving's time". This is why my posting time "changes" between summer and winter, from midday to 11am and back again. It seemed like the easiest thing to do at the time.

Now, what I'd like to do is let people say "Post at midday", and then have that stick at midday, so that when DST kicks in it's _still_ midday in their local timezone. This brings a few issues:
A) I can't just say "Pick up the last day's posts", because a "day" can now contain either 23,24, or 25 hours, if we've crossed a DST barrier (And I would be unsurprised to discover that there are places that change by other amounts too). So after the first post, all posts have to pick up the links "since the last post". Unless, of course, subtracting days works with DST. Which it might do. More research needed.

B) I have to do some conversion back and forth to cope with the face that the time on the server is not necessarily the time at the user's web browser, which is not necessarily the time in the timezone they've selected. If a user has "PST" set, and then pops over to New York, should the "time of next post" show in EST, PST, or something else? Which is the least confusing for the user?

And, of course, I don't expect that both JavaScript and Java will handle these things in the same way.

The timestamp issue, I think, is handled fairly easily. Should work the same way in the new system as it currently does.

Handling users setting up posting times in their own timezones, on the other hand, sounds like it's going to be...fun. Particularly (B) - because I don't think there's a "right" answer. *sigh*

Any suggestions?



Original post on Dreamwidth - there are comment count unavailable comments there.
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 25 comments