We will use America/Los_Angeles as example. Fill in the value of the timezone as this:
date.timezone = America/Mexico_City
Save your php.ini file and restart your server. From now on, your date/time functions will rely on this setting.
The second option to solve this warning is by using a already existing PHP build-in function “date_default_timezone_set()”. Somewhere before your date/time function type the following line as this:
<?php
// Set timezone
date_default_timezone_set('America/Mexico_City');
// Create string, date of tomorrow
echo date('Y m-d', strtotime('+1 day', time()));
?>
Add the following line to .htaccess:
SetEnv TZ America/Mexico_City
No comments:
Post a Comment