Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7044001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:21:27+00:00 2026-05-28T02:21:27+00:00

I have a javascript countdown timer that works by taking a specified date and

  • 0

I have a javascript countdown timer that works by taking a specified date and time, and comparing it to the current date and time. The issue is, the current time is relative to the users timezone, so the time remaining is different between users.

How can I have the timer countdown till a time in a specific timezone, in my case GMT -5 hours?

I understand i can use the below code to get the users timezone, but I am lost as how to use this.

myDateObj.getTimezoneOffset( ) / 60

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:21:28+00:00Added an answer on May 28, 2026 at 2:21 am

    A quick search reveals: convert-the-local-time-to-another-time-zone-with-this-javascript

    Following the article verbatim gets you this example:

    var d = new Date();
    
    var localTime = d.getTime();
    
    var localOffset = d.getTimezoneOffset() * 60000;
    
    var utc = localTime + localOffset;
    
    // obtain and add destination's UTC time offset
    // for example, Bombay 
    // which is UTC + 5.5 hours
    var offset = 5.5;   
    var bombay = utc + (3600000*offset);
    
    var nd = new Date(bombay); 
    alert("Bombay time is " + nd.toLocaleString() + "<br>");
    

    jsFiddle: http://jsfiddle.net/GEpaH/

    Just update with your desired offset and you should be all set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a countdown timer in javascript that is called by a code behind
I am trying to create a javascript countdown timer; I have a string that
I have a timer that counts down every second. It works great until the
I'm trying to create a countdown timer that's based on a time on the
I have created a javascript timer that starts at 40 and counts down by
I have Javascript that opens another window and registers a click handler for all
I have JavaScript that is doing activity periodically. When the user is not looking
I have javascript string variable with var sttr=We prefer questions that can be answered
Is it possible to have JavaScript compute a timestamp returned from PHP's time() function
I've been writing some jQuery functions that have JavaScript variables and looping, etc inside

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.