shahzad429 Posted February 26, 2012 Share Posted February 26, 2012 I am trying to display date and time below code display date correctly but when it come to display time it display 3 hour behind. eg. when it is 12:47 PM in my system it display 9:47 PM <?php $todaydate=date("j - F - Y g:i:s a"); echo $todaydate; ?> Quote Link to comment https://forums.phpfreaks.com/topic/257809-time-3-hour-behind/ Share on other sites More sharing options...
joel24 Posted February 26, 2012 Share Posted February 26, 2012 you need to set PHP's timezone; http://php.net/manual/en/function.date-default-timezone-set.php Quote Link to comment https://forums.phpfreaks.com/topic/257809-time-3-hour-behind/#findComment-1321377 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.