How to get WP to use EST Timezone

date() is unreliable in WP since it always resets time zone to UTC and uses its own processing for time zones. date_i18n() is usually preferable WP replacement, but it will also localize output, which might be unwanted. What you want for correct unlocalized output is to: Get data out of WP API without its offset … Read more

When does next Cron Job run (time from now)?

Edit: wp_next_scheduled() returns the timestamp of the next scheduled job of a specified wp-cron job-arguments pair. Please note that this differs slightly in functionality to the answer below, in that you have to provide the arguments passed to cron job’s callback (if it has any). The original answer would provide the time of the next … Read more

How to convert DateTime() to display time based on WordPress timezone setting?

I’m not sure why EliasNS’ answer is marked correct, as far as I’m aware (and from the documentation), the second parameter of DateTime::__construct(), if provided, should be a DateTimeZone instance. The problem then becomes, how we do we create a DateTimeZone instance. This is easy if the user has selected a city as their timezone, … Read more

Default timezone hardcoded as UTC?

Somehow I missed the current_time function, which gives a good description of the situation and how to properly deal with the need to get the current blog-local time. http://codex.wordpress.org/Function_Reference/current_time Though the purist in me still hates how WP makes the time zone setting in php.ini obsolete without giving you a choice. *grumble grumble*