epic_era1 Posted April 7, 2008 Share Posted April 7, 2008 Hello, I'm having a bit of problem with the date("H:i", time()); , i'ts returning one hour ahead of the real time and I can't figureout why? any help is most appreciated.. thanks in advance Link to comment https://forums.phpfreaks.com/topic/100018-getting-wrong-time-with-datehi-time/ Share on other sites More sharing options...
AndyB Posted April 8, 2008 Share Posted April 8, 2008 date("H:i") is going to return the value of time on the server which is probably not in your time zone. The real time is ... variable. Link to comment https://forums.phpfreaks.com/topic/100018-getting-wrong-time-with-datehi-time/#findComment-511628 Share on other sites More sharing options...
kevin7 Posted April 8, 2008 Share Posted April 8, 2008 correct, date() function will returnt the server time instead of your local computer time, you can add or minus to make it right. Link to comment https://forums.phpfreaks.com/topic/100018-getting-wrong-time-with-datehi-time/#findComment-511673 Share on other sites More sharing options...
AndyB Posted April 8, 2008 Share Posted April 8, 2008 correct, date() function will returnt the server time instead of your local computer time, you can add or minus to make it right. Gee, thanks for the confirmation Or was it just a post count booster? Link to comment https://forums.phpfreaks.com/topic/100018-getting-wrong-time-with-datehi-time/#findComment-511687 Share on other sites More sharing options...
kevin7 Posted April 8, 2008 Share Posted April 8, 2008 nah, it happed to me once, the server was located in US, and the competition was located in Australia, I miscalculated the time different, the competition closed earlier one hour.. oops... so, now im very becareful with the timezone. Link to comment https://forums.phpfreaks.com/topic/100018-getting-wrong-time-with-datehi-time/#findComment-511688 Share on other sites More sharing options...
epic_era1 Posted April 8, 2008 Author Share Posted April 8, 2008 would this happen if the host is on my own computer? Link to comment https://forums.phpfreaks.com/topic/100018-getting-wrong-time-with-datehi-time/#findComment-512022 Share on other sites More sharing options...
discomatt Posted April 8, 2008 Share Posted April 8, 2008 It shouldn't Link to comment https://forums.phpfreaks.com/topic/100018-getting-wrong-time-with-datehi-time/#findComment-512036 Share on other sites More sharing options...
moon 111 Posted April 8, 2008 Share Posted April 8, 2008 You can use date_default_timezone_set to set the default time zone. Link to comment https://forums.phpfreaks.com/topic/100018-getting-wrong-time-with-datehi-time/#findComment-512079 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.