jsch / datejs

Automatically exported from code.google.com/p/datejs
Other
0 stars 0 forks source link

Date.parse('12/3/2009 12:56 PM') fails #90

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Date.parse('12/3/2009 12:56 PM')
2.     returns null

What version of the product are you using? On what operating system?
  Build 2008-05-13, Mac Safari

Original issue reported on code.google.com by aaron.d....@gmail.com on 4 Dec 2009 at 6:11

GoogleCodeExporter commented 9 years ago
I'm having the same error.

alert(Date.parse('12/08/2009 12:59 PM').toString("MMMM dd, yyyy HH:mm:ss"));

Error:

Microsoft JScript runtime error: 'Date.parse(...)' is null or not an object

Original comment by noel.cap...@yahoo.com on 17 Dec 2009 at 6:30

GoogleCodeExporter commented 9 years ago
@aaron

I think the 'PM' causes the error. I replaced mine with 24h format and it works.

Date.parse('12/08/2009 12:59:00').toString("MMMM dd, yyyy HH:mm:ss")

Original comment by noel.cap...@yahoo.com on 17 Dec 2009 at 6:48

GoogleCodeExporter commented 9 years ago
Yes, it seems to be the combination of the 12-hour time format with the hour 
being 12. It's a good idea to just 
do date_string.gsub(' PM', ':00'). Thanks for that.

Original comment by aaron.d....@gmail.com on 17 Dec 2009 at 7:24

GoogleCodeExporter commented 9 years ago
By the way, I've seen references that suggest the 12 PM parse issue is solved 
by a newer version of the library, 
but I believe that Build 2008-05-13 is the newest version available, and it 
still has the problem.

Original comment by aaron.d....@gmail.com on 17 Dec 2009 at 7:25

GoogleCodeExporter commented 9 years ago
I had this issue with the older version and upgrading to the new Build 
2008-05-13 fixed 
it

Original comment by jjoseph%...@gtempaccount.com on 17 Apr 2010 at 8:07

GoogleCodeExporter commented 9 years ago
I was using 2008-05-13 -- see original post. Did you try this exact expression:

    Date.parse('12/3/2009 12:56 PM')

If so, maybe there's a newer build 2008-05-13! I'll look into it, again.

Original comment by aaron.d....@gmail.com on 17 Apr 2010 at 5:26

GoogleCodeExporter commented 9 years ago
works in the current build on my fork: https://github.com/abritinthebay/datejs/

Original comment by darkcr...@gmail.com on 16 Sep 2013 at 7:19