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, 2022 in Node-js by Vaani
• 7,020 points
1,646 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, 2022 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,880 points
13,133 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,880 points
4,065 views
0 votes
1 answer

How to schedule a google meet and get the meet link in NodeJs?

To create a Google Meet, you'll need ...READ MORE

answered May 27, 2022 in Node-js by Neha
• 9,060 points
3,446 views
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,880 points
2,997 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, 2022 in Node-js by Vaani
• 7,020 points
319 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,691 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,232 views
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, 2022 in Node-js by Neha
• 9,060 points
4,397 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP