[wp-hackers] peculiar problem on setting GMT

SoJ Web sojweb at indiana.edu
Wed Apr 15 17:05:36 GMT 2009


Way ahead of you, made the plugin last night :-). I wasn't aware of  
that pre_option_gmt_offset filter, though, that'll make it simpler;  
many thanks. I'm doing some polishing and will upload it later.


-Jeff

On Apr 15, 2009, at 12:37 PM, Otto wrote:

> On Wed, Apr 15, 2009 at 7:43 AM, SoJ Web <sojweb at indiana.edu> wrote:
>> I was actually speaking to a related, but different issue: not  
>> displaying in
>> the viewer's time zone, rather, displaying the author's time zone.  
>> So if the
>> server is in central time, and I'm in eastern, the published dates  
>> for my
>> posts will show my (eastern) time (while also displaying the GMT  
>> offset...
>> otherwise it could get really confusing).
>
> Ahh. Well, okay, for that you don't need any special display code at
> all. Just a per-user timezone adjustment setting. Then, the post_date
> will get set by the user values instead of the overall blog values,
> and the_date() will display the author time more or less
> automatically. If you want to get the gmt time of a post, you have to
> use get_post_time() with the second parameter being true, just like
> always.
>
> This is even a relatively easy plugin to do. Just have a usermeta
> value to store the user's timezone, then stick a filter onto
> pre_option_gmt_offset to adjust the offset accordingly for the current
> user. Done.
>
>
> -Otto
> Sent from Memphis, Tennessee, United States
> _______________________________________________
> 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