Friday, January 20th, 2012
Who’d have thought that FireFox has a problem telling the time? If you try and create a new ‘Date()’ object and set the time to zero, most browsers return 1st Jan 1970 at 00:00, however FireFox seems to think that I’m currently in BST and return 1:00am. Magic:
Here’s what Chrome says:

And here’s what FireFox says:

So, how does one get around this? Well with a bit of cunning it seems. FireFox returns ‘Date.getTimezoneOffset()’ as -60 and this is what we need to put the clocks back:
{
// a fix for FireFox's time issue
var o = t.getTimezoneOffset();
var n = o ? o / -60 : 0;
return appendZero( t.getHours() - n ) + ':' + appendZero( t.getMinutes() ) + ':' + appendZero( t.getSeconds() )
}
var d = new Date();
d.setTime( 0 );
console.log( formateTime( d ) );