leequalls Posted February 15, 2011 Share Posted February 15, 2011 I am in need of a script that can detect a visitors timezone with out using geoip and with out the user providing the information. Any help on this or references would be greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/227795-timezone/ Share on other sites More sharing options...
AbraCadaver Posted February 15, 2011 Share Posted February 15, 2011 It will be javascript: https://bitbucket.org/pellepim/jstimezonedetect/wiki/Home Quote Link to comment https://forums.phpfreaks.com/topic/227795-timezone/#findComment-1174686 Share on other sites More sharing options...
leequalls Posted February 15, 2011 Author Share Posted February 15, 2011 ok how would I translate it to php from java? Quote Link to comment https://forums.phpfreaks.com/topic/227795-timezone/#findComment-1174689 Share on other sites More sharing options...
AbraCadaver Posted February 15, 2011 Share Posted February 15, 2011 ok how would I translate it to php from java? You don't. PHP is run on the server and has no access to the client. It does sometimes receive info from the client but nothing to do with date/time or timezone. Quote Link to comment https://forums.phpfreaks.com/topic/227795-timezone/#findComment-1174690 Share on other sites More sharing options...
leequalls Posted February 15, 2011 Author Share Posted February 15, 2011 ok here is what I am trying to do and I dont think it will work using java. I have a schedule written in php and gets a list of data for each time. I need the data to be on the correct time for the visitors timezone. Example: The server is in EST so for 12pm it displays data from the MySQL if a visitor in CST looks at the schedule they need to see the 12pm data in the 11am time slot. Quote Link to comment https://forums.phpfreaks.com/topic/227795-timezone/#findComment-1174705 Share on other sites More sharing options...
Jessica Posted February 15, 2011 Share Posted February 15, 2011 1. Java != Javascript 2. I'd start by specifying what time zone the events occur in, and let them select a different one to view if they want to . 3. Or, look at using AJAX to send javascript information to PHP. Quote Link to comment https://forums.phpfreaks.com/topic/227795-timezone/#findComment-1174706 Share on other sites More sharing options...
jcbones Posted February 15, 2011 Share Posted February 15, 2011 2 ways: 1. Use a form to ask the user for their timezone. 2. Have javascript set a cookie, send an ajax request to the server, check the cookie, then set the timezone with PHP. Only 2 ways I could think of, off the cuff. Quote Link to comment https://forums.phpfreaks.com/topic/227795-timezone/#findComment-1174707 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.