PHPfolife Posted September 23, 2008 Share Posted September 23, 2008 Hello, How do I get users time-zone and set the environment with a cookie so the script reads that time-zone if a cookie exists? I assume the best bet would be with javascript and php right? <script language="JavaScript"> var curDateTime = new Date() document.write("Your Time zone is: ") document.write(-(curDateTime.getTimezoneOffset()/60)) </script> This is what i have now. Any solution? Thanks Link to comment https://forums.phpfreaks.com/topic/125531-users-time-zone/ Share on other sites More sharing options...
discomatt Posted September 23, 2008 Share Posted September 23, 2008 That would be your best bet You can then set a cookie with JS to store it and call with PHP Link to comment https://forums.phpfreaks.com/topic/125531-users-time-zone/#findComment-649057 Share on other sites More sharing options...
PHPfolife Posted September 23, 2008 Author Share Posted September 23, 2008 Okay but the thing is though its not display the right timezone on my computer. I am suppose to be -8 not -7. Link to comment https://forums.phpfreaks.com/topic/125531-users-time-zone/#findComment-649084 Share on other sites More sharing options...
PHPfolife Posted September 24, 2008 Author Share Posted September 24, 2008 Do you think that its -7 because of the daylight savings? Link to comment https://forums.phpfreaks.com/topic/125531-users-time-zone/#findComment-649255 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.