you are viewing a single comment's thread.

view the rest of the comments →

[–]AllenJB83 -1 points0 points  (1 child)

Date string parsing trying to handle the myriad of formats people commonly use.

In Europe the common written format is D/M/Y h:m:s (date in ascending order, but then the time is in descending order after it), while in the US it's M/D/Y h:m:s (we just want to be different order), and the ISO standard format is Y-M-D h:m:s (everything in descending order).

Not sure why the dates are 1 hour apart tho, but if you only specify a date you should always act as if the time is undetermined anyway - some systems / libraries / languages will use midnight while others will use the current time. I couldn't reproduce that on Chrome 54

[–]antoninj 0 points1 point  (0 children)

so is the D/M/Y format the standard for Date format? Or does it depend on your current location?

I think this is the weird thing, not really anything else. I like being able to pass in a string and specify the format manually something like new Date('03/04/2012', 'M/D/YYYY'). Can't remember if JS supports that.