JavaScript timezone tastiness

2006-02-13 00:34:00

A post over at Why's Ruby blog on using Ruby to pitch Unix timestamps out to JavaScript led me to this really nice, long post by Johan Sundstrom on best practices for dealing with JavaScript and timezones. (Why had a really elegant take on strftime, by the way.)

Both of these posts talk about the three options for dealing with timezone issues in your Web app:

  • Doing the full-on user-preference-based timezone thing
  • Totally punting and not dealing with the issue
  • A solution somewhere in the middle -- using UTC timestamps for everything, and letting the client decide what timezone to show.

They advocate the third solution, which likely provides the most reasonable timezone coverage for most Web apps without ridiculous amounts of work.

Unfortunately for us, Scooby will have to have a much more robust timezone implementation, so we're eventually going to have to implement a complete user-preference-based system. Our conversion to the new ScoobyDate data type for event dates is a good start in that direction.


This is the blog for Matthew Eernisse. I currently work at Yammer as a developer, working mostly with JavaScript. All opinions expressed here are my own, not my employer's.


Previous posts

All previous posts ยป

This blog is a GeddyJS application.