[wp-hackers] Changing the clock format in Write > Post

Alexander Beutl xel at netgra.de
Wed May 7 14:45:16 GMT 2008


>
> If you run PHP 5.1 or up, this code will figure out the correct offset
> from the server for a given timezone string (like "America/Chicago"):


Great for a plugin which can easily choose to only support php5.1+
Less useable for core which should be php4.3 complient up to what
wordpress.org says...
But maybe one could add this as an additional benefit if php version is high
enogh as long as one takes care it will not break anything if php < 5.1 is
used.

Would really like to see this go core - no matter if it is possible to be
done in php < 5.1 - just make sure nothing will break...

Alex


2008/5/7 Otto <otto at ottodestruct.com>:

> On Wed, May 7, 2008 at 9:29 AM, Jennifer Hodgdon <yahgrp at poplarware.com>
> wrote:
> > Maybe there's enough in the core of PHP to support them in an easy way
> > (haven't looked into it recently), but if not, good luck!
>
> If you run PHP 5.1 or up, this code will figure out the correct offset
> from the server for a given timezone string (like "America/Chicago"):
>
> $dateTimeZone = new DateTimeZone('America/Chicago');
> $dateTimeServer = new DateTime();
> $timeOffset = $dateTimeZone->getOffset($dateTimeServer);
> $timeOffset = $timeOffset / 3600;
>
> The resulting $timeOffset is in hours, and will be what you should
> choose on the Settings->General page. That's the basis for the plugin.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list