Skip to main content

Unable to get timezone for unix timestamp

I'm trying to get the timezone for Autralia and print a unix timestamp however the timestamp just read UTC opposed to Australia time.

Here is what I'm working with:

//Get todays date
var d = new Date()
//convert to timezone
d.toLocaleString("en-US", {timeZone: "Australia/Sydney"});

const insevendays = Math.floor(new Date(d.getFullYear(), d.getMonth(), d.getDate(), 0,30,0) / 1000 + 604800)
d.toLocaleString("en-US", {timeZone: "Australia/Sydney"});

Is not outputing the correct timezone.

Via Active questions tagged javascript - Stack Overflow https://ift.tt/2OenTcw

Comments