im trying to get date object with current time of specific time zone,
var options = {
timeZone: 'Asia/Novokuznetsk',
year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: false
},
formatter = new Intl.DateTimeFormat([], options),
date_string = formatter.format(new Date()),
dsplit = date_string.split(","),
date_arr = dsplit[0].split("/"),
time_arr = dsplit[1].split(":"),
now = new Date(date_arr[2], date_arr[0] - 1, date_arr[1], time_arr[0], time_arr[1], time_arr[2]);
And now
outputs correct current time of specific timezone. Main problem is that not all timezones are supported by this example. Is there any better way to get date object of current time in specific timezone?