Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get a gmt / universal / server date, not local

Status
Not open for further replies.

styleBunny

Technical User
Jun 20, 2002
133
AU
Hi guys,

Im doing a js list of dates that only displays the dates that have not passed. Tho so far using 'new date' all i get is a local system time which can be dubious if the clock is incorrectly set on the users system. How can i get a GMT or server date to evaluate my list against?

I tried getUTC methods but that still seemed to reflect changes in the the local time. Just displayed in a differnt format.

cheers,
sb.
 

You can only get the time from a server if you know of a server that will serve you the time.

For client-side JS, your best option would be to get a server that serves you the current time as a variable in a JS file that you can include on a page.

Hope this helps,
Dan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top