-
Date() bug in JavaScript
Hi,
I found out that some PC add 1 hour to the time for the below code.
Please advise how to collect it.
Thanks in advance!
<script language=Javascript>
var d;
d = new Date();
document.write("Local Time(JS): ");
document.write(d);
</script>
Most of the PC will return:
Local Time(JS): Fri Jun 28 18:29:46 UTC+0800 2002
but some PC will return:
Local Time(JS): Fri Jun 28 19:29:46 UTC+0800 2002
-
Re: Date() bug in JavaScript
Daylight savings?
"gek po" <webdev.@127.0.0.1> wrote in message news:3d1c39c1$1@10.1.10.29...
>
> Hi,
>
> I found out that some PC add 1 hour to the time for the below code.
> Please advise how to collect it.
> Thanks in advance!
>
> <script language=Javascript>
> var d;
> d = new Date();
> document.write("Local Time(JS): ");
> document.write(d);
> </script>
>
> Most of the PC will return:
> Local Time(JS): Fri Jun 28 18:29:46 UTC+0800 2002
>
> but some PC will return:
> Local Time(JS): Fri Jun 28 19:29:46 UTC+0800 2002
-
Re: Date() bug in JavaScript
Not sure. I have checked all the PC Date/Time and Regional Option setting,
but can't find where to set/correct the daylight savings.
Please advise.
Besides, may I know Javascript take the local time from which setting?
Thanks in advance!
"Matthew Solnit" <spam sucks!> wrote:
>Daylight savings?
>
>"gek po" <webdev.@127.0.0.1> wrote in message news:3d1c39c1$1@10.1.10.29...
>>
>> Hi,
>>
>> I found out that some PC add 1 hour to the time for the below code.
>> Please advise how to correct it.
>> Thanks in advance!
>>
>> <script language=Javascript>
>> var d;
>> d = new Date();
>> document.write("Local Time(JS): ");
>> document.write(d);
>> </script>
>>
>> Most of the PC will return:
>> Local Time(JS): Fri Jun 28 18:29:46 UTC+0800 2002
>>
>> but some PC will return:
>> Local Time(JS): Fri Jun 28 19:29:46 UTC+0800 2002
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks