Is it safe to use 'date_default_timezone_set' in plugin file?
Question
I am using a sitemaps plugin which in very complex ways sets the timezone of <lastmod>
(i.e. last modified time) for posts to GMT.
Temporarily, until the plugin developer fixes it, I need to enforce a custom timezone on the plugin. The simple and straightforward way that I've found is to add something like date_default_timezone_set( 'America/New_York');
right after the first <?php
in the file responsible for outputting the sitemaps.
It works, and it doesn't seem to affect timestamps displayed on the rest of the site. So, can I go with this? or is there a better solution?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange