I am trying to see dates based on some json data that I have.
My code is:
var date = new Date(json.events[i].event.first_date); alert(date);
Now that json.events[i].event.first_date just returns a date in the format yyyy-mm-dd .
I noticed, however, that when I do alert(date); They show me the day before the date that the actual data is talking about.
For example, json.events[0].event.first_date indicates the date 2015-06-02 , but the warning is displayed on June 1, 2015.
I get my json from a URL based somewhere in Germany and I am in the USA. Can a date be ruined due to time zones?
javascript date timezone
Jaken herman
source share