Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I use my server clock for the current time instead of relying on clients browser?

0
Posted

How do I use my server clock for the current time instead of relying on clients browser?

0

A- Using server time has some advantages. It obviates the use of the client’s clock which might not be accurate. Time zone and daylight savings issues are also avoided. However, server resources must be used to set the current time dynamically every time the page is accessed. You would need access to server-side scripting to make that possible. The quickest way to achieve this is to change your page extension to a server-processed one (such as .php, .asp, .aspx, .jsp, etc.) that your server supports. You would need to download countdown.js, incorporate it into your page, and modify one line. the line to change is towards the end of the script where “dnow” is declared as: var dnow = new Date(); For example, in PHP you would use: var dnow = new Date(““); In ASP (JScript) you would use: var dnow = new Date(“<%= new Date() %>“); If your server supports SSI, then you can declare the following: var dnow = new Date(“

0

A- Using server time has some advantages. It obviates the use of the client’s clock which might not be accurate. Time zone and daylight savings issues are also avoided. However, server resources must be used to set the current time dynamically every time the page is accessed. You would need access to server-side scripting to make that possible. The quickest way to achieve this is to change your page extension to a server-processed one (such as .php, .asp, .aspx, .jsp, etc.) that your server supports. You would need to download countdown.js, incorporate it into your page, and modify one line.

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.