Feature #19286
closedSetting default UTC Timezone to match NYC timezone
0%
git submodule update (for cac-site-templates)
Description
Hi All,
Would it make sense to set to the daulty UTC timezone to match the NYC timezone (currently UTC -5)?
I noticed today and several times before when creating posts, it will say they were created 5-6 ahead. I can see how this might create issues if professors have due dates set for midnight.
I imagine that setting the default timezone to match NYC would make sense as a default for most CUNY classes. What do you all think?
Tested default here: https://testingdefaultutc.commons.gc.cuny.edu/wp-admin/options-general.php
See screenshot.
Files
Updated by Boone Gorges about 1 year ago
- Assignee set to Jeremy Felt
Laurie, I agree that this is a good idea.
It seems like a similar feature was requested long ago in WordPress, but the answer was "do it with a filter". https://core.trac.wordpress.org/ticket/25345 However, there are, as far as I can tell, no filters that will allow you to do this. See eg populate_options()
, wp_initialize_site()
. I think what we need instead is a callback for 'wp_initialize_site'
(later than 10, which is where the wp_initialize_site()
function runs) that sets the gmt_offset and timezone_string options. Jeremy, would you mind confirming this analysis and writing the necessary code?
Updated by Laurie Hurson about 1 year ago
This sounds good to me!
Thanks Boone and Jeremy!
Updated by Jeremy Felt 12 months ago
Two bits to this:
1. On the CAC repo, the fix/set-default-timezone branch uses the wp_initialize_site_args
filter to set the default timezone_string
option for all new sites to America/New York.
2. On the CAC site templates repo, the fix/preserve-time-zone branc adds timezone_string
to the list of options ignored when "cloning" new sites from site templates.
This feels better than re-updating the option after the fact.
Updated by Boone Gorges 12 months ago
- Status changed from New to Staged for Production Release
- Deployment actions updated (diff)
Looks like the right strategy, Jeremy. Thanks!
I've merged branches and pinned the commit for cac-site-templates.
Updated by Boone Gorges 12 months ago
- Status changed from Staged for Production Release to Resolved