Why does javascript interpret these identical dates differently -
Why does javascript interpret these identical dates differently -
what's going on here:
> new date('apr 15 2013'); mon apr 15 2013 00:00:00 gmt+0100 (gmt daylight time) > new date('04/15/2013'); mon apr 15 2013 00:00:00 gmt+0100 (gmt daylight time) > new date('2013-04-15'); mon apr 15 2013 01:00:00 gmt+0100 (gmt daylight time)
obviously, 1 beingness interpreted utc time, while other 2 beingness interpreted local time. causes difference in parsing?
from specification:
the string may interpreted local time, utc time, or time in other time zone, depending on contents of string. function first attempts parse format of string according rules called out in date time string format (15.9.1.15). if string not conform format function may fall implementation-specific heuristics or implementation-specific date formats.
of formats provided, '2013-04-15'
officially supported, others seem fall implementation-dependent behavior.
javascript date
Comments
Post a Comment