Martin Tournoij
2014-02-17 13:14:40 UTC
Message: date() [function.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.
I know *what* this error means, I don't quite understand why PHP considers thesettings. You are required to use the date.timezone setting or the
date_default_timezone_set() function.
system's timezone unreliable?
All other programming languages I've used just use the systems timezone without
problems, and most applications (servers applications, desktop apps) just use
the system setting.
For example, in C:
#include <time.h>
#include <stdio.h>
int main() {
char out[255];
time_t now = time(0);
struct tm *ltime = localtime(&now);
tzset();
strftime(out, sizeof(out), "%z, %Z", ltime);
printf("%s\n", out);
}
Gives me: +0100, CET, which is the expected output.
Is this somehow unreliable? This is all POSIX stuff, so I would expect it to
work well on at least all POSIX sysyems, or am I missing something?
PS. Please CC me, as I am not subscribed to this list!
Thanks,
Martin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php