Yesideez Posted February 2, 2008 Share Posted February 2, 2008 I'm in the UK but the server hosting my website is in the US and I've been playing around with a timer script. I'm setting a time in the future: $expiretime=time()+($cachedelay*$secondsinanhour) That value is being stored in my database. Every time my script runs I check that value like this: $timeleft=$expiretime-time(); if ($timeleft<0) {echo 'timer expired';} else {echo 'time left is '.gmdate('H:i:s',$timeleft);} Now this is working for me, the timer works fine using gmdate() but what about someone in America? Would this fail or am I safe? I'm writing a PHP Nuke module for keeping track of members in a Battlefield 2 clan and most of the clan members are in the US so I need this to work. Quote Link to comment https://forums.phpfreaks.com/topic/89031-timer-do-i-use-gmdate-or-date/ Share on other sites More sharing options...
Yesideez Posted February 2, 2008 Author Share Posted February 2, 2008 Anyone here in America who can copy and paste the timer into here so I can see how it works? Quote Link to comment https://forums.phpfreaks.com/topic/89031-timer-do-i-use-gmdate-or-date/#findComment-455975 Share on other sites More sharing options...
Yesideez Posted February 2, 2008 Author Share Posted February 2, 2008 Is there anyone I can PM a link to my website to check this timer please? Quote Link to comment https://forums.phpfreaks.com/topic/89031-timer-do-i-use-gmdate-or-date/#findComment-455987 Share on other sites More sharing options...
laffin Posted February 2, 2008 Share Posted February 2, 2008 U are safe, the time function isn't reliant on the users timezone. but how the server was setup. usually the servers timezone so no matter who uses it, they will see the servers time Quote Link to comment https://forums.phpfreaks.com/topic/89031-timer-do-i-use-gmdate-or-date/#findComment-455994 Share on other sites More sharing options...
Yesideez Posted February 2, 2008 Author Share Posted February 2, 2008 Thanks for helping clear that up. I've been sat here waiting for ages reading up on bits and pieces - I can get on with this script now Quote Link to comment https://forums.phpfreaks.com/topic/89031-timer-do-i-use-gmdate-or-date/#findComment-455995 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.