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 8320309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:36:54+00:00 2026-06-08T22:36:54+00:00

Our team are having big issues with the JQuery countdown and we really need

  • 0

Our team are having big issues with the JQuery countdown and we really need some help.

Initially, we had some ScriptSharp code that does this

JQueryCountdownOptions opts = new JQueryCountdownOptions();
opts.Layout = "<ul class=\"group\"> <li>{dn} <span>{dl}</span></li> <li>{hn} <span>{hl}</span></li> <li>{mn} <span>{ml}</span></li> <li>{sn} <span>{sl}</span></li> </ul>";
opts.Until = Number.ParseInt(timeLeft);

jQuery.Select("#countdownclock").Plugin<JQueryCountdown>().Countdown(opts);
jQuery.Select("#countdownclock").Show();
jQuery.Select("#bidBox").RemoveAttr("disabled");

What we noticed is that this uses the client’s clock to countdown from. So, if the client decided to change his time to 5 hours ahead then the countdown would be 5 hours off.

To fix this we introduced some more code

In the view:

   $(function () {

        var expires = new Date(@year, @month, @day, @hours, @minutes, @seconds);
        $('#clockDiv').countdown({ until: expires, timeZone: null, serverSync: serverTime, onTick: serverTime, tickInterval: 60 });

        function serverTime() {
            var time = null;
            $.ajax({ url: '/Auction/SyncServerTime',
                async: false, dataType: 'json',
                success: function (result) {
                    time = new Date(result.serverTime);
                }, error: function (http, message, exc) {
                    time = new Date();
                }
            });
            return time;
        }
});

In the controller

public JsonResult SyncServerTime()
        {
            var result = new JsonResult
            {
                Data = new
                {
                    serverTime = DateTime.Now.ToString("MMM dd, yyyy HH:mm:ss zz")
                },
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            };
            return result;
        }

This code ensures that no matter what the user sets his clock to the countdown timer will periodically sync to the server’s time. Problem solved.

The only issue is that we have come up with other issues.

The problem is that when users are in different timezones then the countdowns of those users are different depending on the timezone offset that their timezone has. We have tried changing all sorts of parameters and still are having issues. To make matters worse if my timespan straddles a date when daylight saving time is applied then things go awry again, both for those in the same timezone and those in different ones. We have experimented with different code and parameters so the above is just what I did and is different from what my esteemed colleagues tried. What I am asking is surely, someone somewhere out there must have had a requirement to

  1. Write a countdown that is independent of client time and based on server time.
  2. Shows the same number of days, hours, minutes, seconds remaining no matter what timezone a user is in
  3. Shows the same number of days, hours, minutes, seconds remaining for a user whose time will change in this period because of DST to user whose time will not change in this period because of DST
  4. Shows the actual number of days, hours, minutes and seconds remaining for a user whose time will change in this period because of DST.

We cannot be the only people who have ever had this issue, surely. It cannot be this hard. Does anyone know a solution?

Thanks,

Sachin

  • 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-06-08T22:36:56+00:00Added an answer on June 8, 2026 at 10:36 pm

    I haven’t dealt with the same scenarios personally, but seeing Date, timezone issues etc. pop up automatically triggers thoughts about some potential issues stemming from the use of local date objects as opposed to UTC date objects.

    IMO, things are simply better off if all computation, serialization of dates only worked in the UTC space, and finally when it comes to present a date from a user, it is converted to local or appropriate time zone depending on the scenario. On the flip-side, the user enters local or some time zone relative entry, and immediately that is converted to UTC as the internal representation. This avoids all sorts of confusion across different layers/tiers of the app.

    Its not really a solution to your specific problem, but perhaps something to consider that could lead to one.

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

Sidebar

Related Questions

We are having this discussion in our team about code conventions for Java for:
I'm having some troubles organising a new workflow for our small dev team. Our
Our team recently upgraded to TeamCity 4.5.4 but we're having trouble with TeamCity running
I am creating an application to help our team manage a twitter competition. So
I'm having an issue with duplicates being inserted on refresh. Our team here decided
we are having lab machines behind firewall. We used to ask our IT team
My team is working on educating some of our developers about testing. They understand
Our team is having a heated debate as to whether we allow failing unit
Our team has been using starUML and we had to divide our job to
Our team is now beginning to look at jumping from 2.0 to 3.5 and

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.