I want to convert a specific date string with a specific timezone to another timezone in another format. Here is an example:
var date = '2020-04-09 17:10:57'; //Date in YYYY-MM-DD HH:MM:SS format
var timezone = 'America/New_York'; //Timezone of the given var date
Now I want to convert this date in the timezone to another so for example i have:
var convert_to_timezone = 'Europe/Berlin';
I just know, how to get the current users date, but I dont know, how to convert exactly this date with exactly this timezone to another. I also want to respect daylight saving time.
The output should be:
//2020-04-09 23:10:57
Thanks in advance, you would really help me with an answer because I tried this 2 hours and dont get it :(