How to get Australia Sydney timezone offset in javascript nodejs

0 votes
Austalia/Sydney timezone offset (UTC to AEST difference) is +10:00 (from April first Sunday) and +11:00 (from April first Sunday) (from October first Sunday).

There is a 600 minute or 660 minute difference.

In javascript/nodejs/momentjs, how can I retrieve the time difference? Regardless of server time?
Jun 15 in Node-js by Vaani
• 7,020 points
38 views

1 answer to this question.

0 votes

It is very easy with Moment JS. You can try different options from the docs.

var Apr = moment("2020-04-05").tz("Australia/Sydney").format('Z');
var Oct = moment("2020-10-04").tz("Australia/Sydney").format('Z');
    
console.log("Difference from April first Sunday",Apr);
console.log("Difference from October first Sunday",Oct);
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.4.1/moment-timezone-with-data-2010-2020.min.js"></script>
answered Jun 16 by anonymous

Related Questions In Node-js

0 votes
1 answer

How to get the _id of inserted document in Mongo database in NodeJS?

Hello @kartik, A shorter way than using second ...READ MORE

answered Sep 7, 2020 in Node-js by Niroj
• 82,740 points
8,481 views
0 votes
1 answer

How to get path from the request in nodejs?

Hello @kartik, Try this out: var http = require('http'); var ...READ MORE

answered Oct 14, 2020 in Node-js by Niroj
• 82,740 points
2,360 views
0 votes
1 answer
0 votes
1 answer

How to get GET (query string) variables in Express.js on Node.js?

Hello @kartik, Since you've mentioned Express.js in your ...READ MORE

answered Jul 8, 2020 in Node-js by Niroj
• 82,740 points
1,959 views
0 votes
0 answers

No US HAWAII time zone in Momentjs or nodejs

How can I use Momentjs to adjust ...READ MORE

Jun 23 in Node-js by Vaani
• 7,020 points
22 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,009 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to use pino-transport in nodejs for logs?

Ensure that you have a recent version ...READ MORE

answered Jun 9 in Node-js by Neha
• 8,740 points
259 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP