everisk Posted April 4, 2008 Share Posted April 4, 2008 Hi, I have a problem when I use a simple date function to print date and time, the time part is always +1 hour. For example, Current time is 2008-04-04 13:49:42 Date function prints 2008-04-04 14:49:42 I check that the server time is correct as well as the time zone. Any idea? I'm just puzzled! Thanks a lot. Link to comment https://forums.phpfreaks.com/topic/99499-date-function-always-output-1-hour/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 4, 2008 Share Posted April 4, 2008 Either the time zone that php is using is not correct or the DST (daylight savings time) changed in the time zone and php is not using an updated database. See the Note: at this link for how you to update the time zone database - http://us2.php.net/manual/en/timezones.php If this is not your server and your host is unwilling or unable to update the database, you will need to select a time zone that gives the correct results. Link to comment https://forums.phpfreaks.com/topic/99499-date-function-always-output-1-hour/#findComment-509059 Share on other sites More sharing options...
everisk Posted April 7, 2008 Author Share Posted April 7, 2008 Thanks. From your comment I figured out a way by setting Default timezone in php.ini. Link to comment https://forums.phpfreaks.com/topic/99499-date-function-always-output-1-hour/#findComment-511012 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.