Upon request, I get a variable in this format:
var time = "25.07.2016 6:59:04";
It is assumed that the default time zone is GMT0.
Tell me, how can I display the date and time in the same format, only for the local time zone + summer time to be taken into account?
The main problem is how to make it clear to the function, where in the received variable 'time' is day, and where is month. This code works if the number of the day is more than 12, but if the date is, for example, 07/03/2016, the day and month change places and the summer hour is lost (because the month changes, of course).
var time = '13.07.2016 6:59:04'; var gmttime = Date.parse(time + 'GMT'); var d = new Date(gmttime); var newdate = d.toString('dd.MM.yyyy HH:mm'); alert(newdate);