My code is working properly in Google Chrome, but not in Safari.
I figured out that I need to convert yyyy-MM-dd HH:mm:ss
to ISO 8601
, but
I think Jose missed one point here - Do not forget to include Z or else there will be lag of the timezone.
new Date('2014-02-18T15:00:48') new Date('2014-02-18T15:00:48Z')
You can use new Date('2014-02-18T15:00:48'.replace(/\s/, 'T')+'Z').
Refer this for more info - new Date() works differently in Chrome and Firefox