[SERVER-2073] Calling Date() with a date string as an argument returns the current time instead of converting the string Created: 08/Nov/10  Updated: 08/Nov/10  Resolved: 08/Nov/10

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 1.6.3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Roy Smith Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux santogold 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:52:42 UTC 2010 x86_64 GNU/Linux


Operating System: Linux
Participants:

 Description   

In the shell, doing, calling Date() gets you the current date, regardless of what argument you give it. Calling "new Date()" gets you the argument string converted:

> Date("November 15, 2010 10:00:00 UTC")
Mon Nov 08 2010 10:42:17 GMT-0500 (EST)

> new Date("November 15, 2010 10:00:00 UTC")
"Mon Nov 15 2010 05:00:00 GMT-0500 (EST)"

This is, at best, unexpected.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 08/Nov/10 ]

This is part of the javascript spec, so we can't change it.

Generated at Thu Feb 08 02:58:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.