How to change clock on site

Script on site, is saying expired


How can i change the time on the site up until Thursday it was a countdown timer for a week, i was wondering how do i change it here on
Jonathan DuaneAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Here's the code that sets the "target" date/time:
// Set the date we're counting down to
var countDownDate = new Date("May 10, 2018 23:59:25").getTime();

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Oh, and it's worth mentioning that you don't have a timezone specified, which means that people in different time zones will see a countdown timer based on their time zone. In other words, if someone in the Pacific timezone and someone in the Eastern timezone both go and hit the page at the same time, the person in Pacific will have an extra 3 hours on his/her countdown compared to the person in the Eastern timezone.

Or if the person in Eastern sees the EXPIRED message, he could change his system clock to another timezone or another time and it would give him more time.

If you want the timer to actually be consistent, then you might need the server to calculate how much time is left and then let Javascript just count down from that point.
Julian HansenCommented:
Following on from Gr8gonzo's post

Specify your time in UTC format.

So, if you are on East Coast Time (US) for instance and you want your countdown to stop at 23:59:25 in your locale then you would need to add 5 hours to your expire time

var countDownDate = new Date(Date.UTC(2018, 04, 11, 04, 59, 25));

Open in new window

Now it should not matter what time zone your visitors are in they should see a consistent countdown timer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.