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

regional settings

Status
Not open for further replies.

JamesGMills

Programmer
Aug 15, 2005
157
GB
Hi!

I am a PHP developer and i would like to use a little bit of Javascript to get the users local regional settings (time zone or somthing) and then store it in my MySQL database so i can use that info to show reports as to where the visitors are viewing from.

Anyone any ideas how to help out on this one?
 
Do you mean you want to be able to auto-detect what the timezone / regional settings are from the user's operating system, or do you mean you want to have the user choose their settings from a drop-down (or other control), and you want to know how to store that?

Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Dan,

I want to auto-detect so that i can then store it in a database to be used in an admin console.

Thanks
 
Detecting a setting of the OS could be tricky... But you might be able to use one of these:

Code:
alert(new Date().getTimezoneOffset());

Code:
alert(new Date());

to try and find the information you need.

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top