I am using a snippet to output a date which works fine, however it causes errors in the system log and to stop this I need to add the
(date_default_timezone_set("Europe/London")); function so my snippet now looks like this
<?php
(date_default_timezone_set("Europe/London"));
echo date(’F Y’);
?>
out of interest Just wondered if anyone can tell me why MODX asks for this as I am no expert at php
Cheers
Ian
-
☆ A M B ☆
- 24,524 Posts
MODx asks for it because PHP wants it. The event log is just reporting the PHP warning/error.
From the PHP documentation
http://www.php.net/manual/en/function.date-default-timezone-set.php
Note: Since PHP 5.1.0 (when the date/time functions were rewritten), every call to a date/time function will generate a E_NOTICE if the timezone isn’t valid, and/or a E_STRICT message if using the system settings or the TZ environment variable.
-
☆ A M B ☆
- 24,524 Posts
I put it in the config.inc.php file (in manager/includes) when I run across a situation where I need it.