PHP timezone from php.ini not being applied
For some reason the date() function is not outputting the
timezone-adjusted date/time. In debugging this, I found a weird disparity.
My timezone is defined in php.ini as America/New_York. When I call this:
php echo ini_get('date.timezone');
I get America/New_York, which is what I expect. However, when I call this:
php echo date_default_timezone_get();
I get UTC. It seems this is responsible for the date() method returning
the time in the UTC timezone. Why is this happening? How do I make PHP
respect the timezone found in php.ini?
No comments:
Post a Comment