Skip to main content
InterviewHubPRO
Section Overview
Q176

Question 176 of 536

Part 4: Prototypes, Object Methods & Event Loop (174 - 253)

33%
JavaScript & V8 Internals (536 Qs)•Part 4: Prototypes, Object Methods & Event Loop (174 - 253)

How do you convert date to another timezone in javascript

mid LevelMost AskedCode ExampleEvent LoopPrototypes

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
  console.log(new Date().toLocaleString("en-GB", { timeZone: "UTC" })); //29/06/2019, 09:56:00