Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#20398 closed defect (bug) (duplicate)

get_date_from_gmt does not respect DST

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


get_gmt_from_date uses DateTime class (albeit in a rather horrible way) to respect DST differences. The dual function get_date_from_gmt does not do the reverse. Hence:

var_dump(get_date_from_gmt('2012-02-01 12:00:00'));

Will return '2012-02-01 12:00:00' if in Europe/London outside DST, but '2012-02-01 13:00:00' inside DST.

Bug was noticed with RSS importer plugin which uses this function. If the core behaviour is by design (i.e. no intention for DST support on this function) then I will open another bug there.

Attachments (1)

20398.diff (1.7 KB) - added by scholesmafia 12 years ago.
Fix to respect DST

Download all attachments as: .zip

Change History (5)

12 years ago

Fix to respect DST

#3 @scholesmafia
12 years ago

From what I can see, the hook described at comment:1:ticket:20328 still only computes the offset based on the current date, not on the date to be computed. I reckon #20328 is still a valid bug and this is a duplicate of it.

#4 @SergeyBiryukov
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.