JS Coding Questions Logo
JS Coding Questions
#172💼 Interview💻 Code

How do you convert date to another timezone in javascript

Advertisement

728x90

You can use the toLocaleString() method to convert dates in one timezone to another. For example, let's convert current date to British English timezone as below,

javascript
1console.log(new Date().toLocaleString("en-GB", { timeZone: "UTC" })); //29/06/2019, 09:56:00

Advertisement

Responsive Ad
🎯 Practice NowRelated Challenge

JavaScript Coding Exercise 1

Test your knowledge with this interactive coding challenge.

Start Coding

Advertisement

728x90
172of476
How do you convert date to another timezone in javascript | JSCodingQuestions.com