jq beginner
jq beginner

Reputation: 1070

date_default_timezone_set displays incorrect time

I'm using date_default_timezone_set function to set the timezone but when I echo the time it displays wrong time on local server xampp

date_default_timezone_set ('Africa/Cairo');
echo "<div style='direction:ltr'>".date("Y-m-d / g:i A")."</div>";

the time now is 10:50 am but it displays 9:50 am. So any ideas?

Upvotes: 0

Views: 888

Answers (1)

deceze
deceze

Reputation: 522016

Possible issues:

  • the server's time is not set correctly, test this by confirming that time in the UTC timezone is correct
  • the timezonedb is outdated and the timezone in question has changed its DST rules in the meantime, update your PHP version and/or your timezonedb via PECL

Upvotes: 1

Related Questions