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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting the time for the client machine location?

Status
Not open for further replies.

sjf

Technical User
Jan 1, 2001
56
AU
How do you format the time and date so it is relevant to the client machine not just the server?
sjf
 
do you mean, converting a date you are using with asp to client side vbscript or javascript? ray
rheindl@bju.edu

 
Sorry, I should be more specific, I mean taking the time from a server located in the US Pacific Time Zone and translating it so the time that is displayed is the time that is relevant to where the web site is about, in this case Eastern Standard Australian Time.

Any ideas?
sjf
 
sjf,

The Javascript Date object has a getTimeZoneOffset method that returns the difference in minutes between UTC and the host computer. You could use that in a client (browser) side script and pass it to the server code where you could use it again to find the variance from UTC on the server and the calculate the two to obtain the relative difference and the adjust a date value to match that of the client computer.

Of course I have not done it so maybe I'm wrong.

Good luck
-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top