IceDragon Posted August 16, 2008 Share Posted August 16, 2008 I have the time code but for some reason it is 14 hours and 4 mins behind my time (i can understand then 14 hours difference due to server time difference,, but 4mins??) anyway, how can I fix the code below so it'd show my time.. something like H+14. I know i've seen it somewhere before just don't remember how to do it. $actualTime = date(DATE_FORMAT); define("DATE_FORMAT","d-m-Y H:i:s a"); Quote Link to comment https://forums.phpfreaks.com/topic/119982-date/ Share on other sites More sharing options...
ignace Posted August 16, 2008 Share Posted August 16, 2008 you can find that in the manual search for setlocale() set your countries locale and the time should automatically adjust Quote Link to comment https://forums.phpfreaks.com/topic/119982-date/#findComment-618052 Share on other sites More sharing options...
s1yman Posted August 16, 2008 Share Posted August 16, 2008 or you could do $actualTime = 50640 + date(DATE_FORMAT) 50640seconds = 60seconds (in a minute) * 60minutes (in an hour) * 14 hours, plus the 240 seconds for the four minutes. But, setlocale() is the better thing to do. Quote Link to comment https://forums.phpfreaks.com/topic/119982-date/#findComment-618108 Share on other sites More sharing options...
IceDragon Posted August 16, 2008 Author Share Posted August 16, 2008 i can't get it to work with setlocale().. Maybe i'm not inserting it right, I just get a blank page. $actualTime = date(DATE_FORMAT); $actualTime = setlocale(LC_TIME, 'svn_SVN'); define("DATE_FORMAT","d-m-Y H:i:s a"); Quote Link to comment https://forums.phpfreaks.com/topic/119982-date/#findComment-618164 Share on other sites More sharing options...
DeanWhitehouse Posted August 16, 2008 Share Posted August 16, 2008 try this find out what time zone it's running in http://uk3.php.net/manual/en/function.date-default-timezone-get.php then set the timezone to how you want it. http://uk3.php.net/manual/en/function.date-default-timezone-set.php Quote Link to comment https://forums.phpfreaks.com/topic/119982-date/#findComment-618167 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.