I have a similar problem. I want to show the WordPress time zone next to my post’s time stamps. If I use ANY of the PHP time-zone abbreviations (e, I, O, P, T, or Z), they reflect the SERVER’s local time zone. Changing the offset in the WordPress control panel does nothing.
I have also discovered that the time/date shown for each post corresponds to the post_date for the item, not the post_date_gmt.
For most users, this is a good thing. If they posted at 6 pm their local time, they want to see “6:00 pm” next to their post. If they move three time zones away and reset their WordPress time-zone settings, they do not want to see the post time change to “3:00 pm” for that same post. None of them use the time-zone display settings, so they are unaware of the underlying incorrect date/time.
I travel all over the world, though, and I LIKE the idea of having my post times change depending on how I set the offset in WordPress. I really do want my post date/time to be based on the GMT value (post_date_gmt), not the local post_date.
I can make out a little bit of what is going on in the_date functions in general-template.php. I can see that there is a $gmt option for get_post_time, but I do not see any way of passing it through from the_date or the_time.
Is there any way to get the real, GMT date/time for a post, so I can display it in my custom theme? What would I replace the normal “the_date” or “the_time” calls with to make it work? I have looked, and do not see a hack or a combination of functions to make it work. I suspect that I could create my own function based on the_date, the_time, get_the_time, and so on, but I am not 100% sure how.
I also help this post sheds some light on the problem that shrapnel faced. When WordPress builds the date/time it is not really building a correct GMT/UTC based date/time. It is taking the post_date, which was adjusted correctly to account for the local time of the person posting it, then sticking it into the server’s local time zone. If you use one of the PHP date/time flags that show the time zone, then you see the problem right away.
Any ideas?