I am looking for a function to convert date in one timezone to another.
It need two parameters,
I don't know an easy method to convert a date object to any time zone, but if you want to convert it to the local time zone, you can just convert it with Date.prototype.getTime()
to the corresponding number of milliseconds, and back again.
date = new Date('2016-05-24T13:07:20');
date = new Date(date.getTime());
For example, date.getHours()
will now return 15
instead of 13
if you are, like me, in Austria (and it's summer).
I've read that the various datetime functions may exhibit non-standard behaviour in some browsers, so test this first. I can confirm that it works in Chrome.