I'm new to CI and I wanted to use Date Helper. I first load the helper then try to use some methods like
PHP Code:
var_dump(human_to_unix('2014-08-14'));
or
PHP Code:
var_dump(unix_to_human(now(), TRUE, 'eu'));
The first method worked well, the second one too, but with a lot of PHP errors (see attached file).
Error messages tell that
Quote:Message: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
I'm currently using MAMP to develop and CI time_reference is set to 'local'. I change it to 'Europe/Paris' but still got the errors; then I passed timezone to the now() method :
06-22-2016, 09:21 AM (This post was last modified: 06-22-2016, 09:21 AM by ciadmin.)
This is a PHP thing - the default timezone needs to be set in php.ini (preferred), or manually in your code before using any of the date/time functions.
"PHP 5.3 now requires that you either have a timezone set in your php.ini file or that you pass the desired timezone via the date_default_timezone_set() function before calling the date() function."