Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#13538 closed defect (bug) (invalid)

Timezone won't appear even if propper PHP date formatting selected

Reported by: avibrazil's profile avibrazil Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9.2
Component: Date/Time Keywords: timezone
Focuses: Cc:

Description

If you put your site under some Timezone on /wp-admin/options-general.php and use a PHP date formatting as "r", you always get wrong +0000 offset.

For example, I use GMT+3 or São Paulo as my Timezone and "r" as the PHP date formatting. I was expecting dates and times as:

"Tue, 25 May 2010 15:20:49 -0300"

but I'm getting:

"Tue, 25 May 2010 15:20:49 +0000"

Note that the time is correct and the same - 15:20:49. Only the Timezone is wrong.

The funny thing is that in the same admin page there is an warning about daylight savings time for my city (São Paulo) that uses the same "r" formating and is correctly printed as:

Daylight savings time begins on: Sun, 10 Oct 2010 01:00:00 -0200 Sun, 10 Oct 2010 01:00:00 -0200

So there is nothing wrong with the PHP installation of my ISP (DreamHost). I was also informed that WP3 also suffers by this same issue but I can't confirm.

You can see the impact of this bug on the published date and time line right after the title of every post on my blog, for example: http://avi.alkalay.net/2009/06/mp3-mass-tagging-and-organization.html

Timezone is important for me because I use to travel and post from different timezones and would like to keep this information as part of the metadata of the post.

Change History (2)

#1 @nacin
14 years ago

  • Milestone Unassigned deleted
  • Resolution set to invalid
  • Status changed from new to closed

It's not an issue, it's by design. Supporting timezones across servers and versions of PHP is best done by setting the internal clock to UTC then working off that.

Cross-referencing: current_time(), date_i18n(), a slew of tickets, and this thread on wp-testers: http://lists.automattic.com/pipermail/wp-testers/2010-April/012671.html.

#2 @avibrazil
14 years ago

  • Cc avibrazil added

OK, I understand what lead to this decision.

But then how someone can get the timezone information of a published post or comment, and the timezone of a post update ?

Would you please provide some pointers so I can get the functionality I need?

Thanks in advance.

Note: See TracTickets for help on using tickets.