Jump to content

Time zone


5kyy8lu3

Recommended Posts

Hi.  I know you can set time zone but for the clients, I can't think of any good ways to have it set a timezone.  Will I have to make a drop down box of time zones and make a script that adjusts server time to their time zone?

 

I'm stumped so any help is appreciated, thanks.  I could just have the user enter the time on their own but I like auto-filling as much stuff as possible to make things more 'user friendly.'  Thanks ahead of time.

Link to comment
https://forums.phpfreaks.com/topic/142751-time-zone/
Share on other sites

If you know your server runs off GMT for exampple your drop down can be built as follows;

 

......and more

(GMT-4) - 6:41

(GMT-3) - 7:41

(GMT-2) - 8:41

(GMT-1) - 9:41

(GMT) - 10:41

(GMT+1) - 11:41

(GMT+2) - 12:41

(GMT+3) - 13:41

(GMT+4) - 14:41

.......and more

 

 

Then at the start of every script set a timestamp;

 

$thetime = time();

 

Adjust for user

 

$userTimeDifference = get this from a db table (example);

$theTime += $userTimeDifference;

 

 

Link to comment
https://forums.phpfreaks.com/topic/142751-time-zone/#findComment-748318
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.