Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
Display current users time who is in different country

Is it possible with vanilla JS to display foreign user time with his timezone?

Example:

  • ME: I am located in Prague (GMT+1)
  • USER: Is located in New York (EDT)

Current time is const localTime = 20:53 GMT+1

Current USER time is const userTime = 15:53 EDT - this is what I want to display to me: USER's time is 15:53 EDT

When USER is logged in in the beginning. I store his timezone offset: const tzOffset = new Date().getTimezoneOffset() Which returns difference from UTC in minutes.

How to with vanilla js display userTime 15:53 EDT using this tzOffset?

I have tried DateTimeFormat but options.timezone does not accept that tzOffset. And new Date has just toLocaleString().

Is there any easy way?

Edit:

Maybe better example

I have chat and there is me and the USER. If I hover over the USER I want to display a tooltip with his time with his timezone. Only what I have on my client is Date.prototype.getTimezoneOffset().

it is easy to add Hours to my current new Date() and get his time. But it is hard to display his timezone - EDT, GMT+/-X etc..

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!