For some time I have been working on a JavaScript library for working with timezones. The name is tzdata-javascript
To use it, you would first load the library like this:
<script type="text/javascript" src="http://tzdata-javascript.org/tzdata-javascript.js">
</script>
(SoylentNews seems to break the URL for the .js file in a weird place, but I'm sure you can figure out what it should be...)
And then use it like this:
<script type="text/javascript">
# Load the timezone you want to use:
var la=new tzdata_javascript.zoneinfo("America/Los_Angeles");
var cph=new tzdata_javascript.zoneinfo("Europe/Copenhagen");
var hk=new tzdata_javascript.zoneinfo("Asia/Hong_Kong");
# Find the timestamp (in ms since Epoch) you want to convert to localtime:
var now=new Date().valueOf();
# Call the strftime() function of each of the timezones, you loaded earlier:
alert(
"The time in Los Angeles is : "+la.strftime("%+",now)+"\n"+
"The time in Copenhagen is : "+cph.strftime("%+",now)+"\n"+
"The time in Hong Kong is : "+hk.strftime("%+",now)+"\n"
);
</script>
And that's about it... :-)
The librarys website has some more demos and examples.
Lurking in the IRC channels for SN this week has been a fantastic experience.
Being exposed to experts ( and idiots ) with arcane bits of knowledge, not to mention the bread recipes has certainly added to my knowledge.
The best conclusion I have drawn though is that a skilled and dedicated team can achieve the near impossible, if they don't mind doing without sleep; I'm impressed.
Don't be there, aloha.