I have some HTML rendered by a Django template that formats a timestamp in ISO 8601 format, e.g:
<span class="my-date">2015-06-04T13:00:00</span>
I am using some Javascript to convert this timestamp to the user's local timezone:
$(document).ready(function(){
$('.my-date').each( function(){
var tz_date = new Date( $(this).text() );
$(this).text( tz_date.toString() );
});
});
This works fine in Chrome (e.g, results in Thu Jun 04 2015 09:00:00 GMT-0400 (EDT)
), but I'm having an issue in Firefox, which is showing Thu Jun 04 2015 13:00:00 GMT-0400 (EDT)
. It seems Firefox is correctly appending the user's timezone, but it is not adjusting the hours.
I wanted to check here if there's some poor assumption I'm making in my code, or if this is a bug in Firefox.