Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to display server time count down?

Posted on 2009-02-16
1
Medium Priority
?
2,524 Views
Last Modified: 2013-12-17
Hi

I use http://www.hashemian.com/tools/javascript-countdown.htm as the js count down.
I get the datetime from server and run the count down js.

However, different machine shows different count down value.

How can the count down timer run in server side, i.e. compare the system time with the future time.
0
Comment
Question by:techques
1 Comment
 
LVL 5

Accepted Solution

by:
mlaise earned 150 total points
ID: 23651802
Off the top of my head I can think of two options you might consider using.  As your code currently stands I am sure (\based on how you described the issue) that it is all run via Client Side javascript.  If this is the case that is why the user is seeing different times: Javascript runs on the local computer and does not communicate with the server.

To get the server time you can do one of the two options:
(1) On the ASP Page Load event pass a javascript variable to the user with the current server time.  Then you can compare that time and the 'local' time in your javascript to define the timezone offset.

http://forums.asp.net/t/886754.aspx

(2) You can use a ASP.Net to create and manage the clock frolm the server side without the use of JavaScript.

http://www.planettutorials.com/Articles/ASPNET/tabid/59/articleType/ArticleView/articleId/15/Create-A-Digital-Clock-in-ASPNET-with-Ajax.aspx
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question