Bug 219460 - Javascript reports time wrongly (TimezoneOffset is wrong)
Summary: Javascript reports time wrongly (TimezoneOffset is wrong)
Status: RESOLVED NOT A BUG
Alias: None
Product: konqueror
Classification: Applications
Component: kjs (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-20 19:56 UTC by alan
Modified: 2009-12-21 09:11 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alan 2009-12-20 19:56:17 UTC
Version:            (using KDE 4.3.4)
OS:                Linux
Installed from:    Debian testing/unstable Packages

Firstly if I type date +%z on the command line, I get +0000 as the
response showing I am in the GMT timezone

If I create a web page with the following text in it

<html>
<body>

<script type="text/javascript">

var d = new Date(0);

document.write('hours = '+d.getHours()+'<br/>');
document.write('time offset = '+d.getTimezoneOffset());

</script>

</body>
</html>

I get different results in different browsers

In Konqueror and Iceweasel I get hours = 1 time offset = -60

In Epiphany and Chrome under Linux I get hours = 0 time offset = 0
In IE, Firefox, Chrome and Safari running Windows XP in a VirtualBox
on the smae machine I get hours = 0 time offset = 0

I believe the second results are correct, the Konqueror and Iceweasel
times are wrong.
Comment 1 alan 2009-12-21 09:11:54 UTC
It has just been explained to me why this is NOT a bug.  On 1st Jan 1970 the UK was trialling running British summer time through the winter, so at Date(0) it WAS GMT+1

Changing Date(0) to Date(<millisecond from 1970 to now>) works and gives time offset 0