Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#46483 closed enhancement (fixed)

Eliminate use of date_default_timezone_set() for calculations in core

Reported by: Rarst Owned by: SergeyBiryukov
Priority: normal Milestone: 5.3
Component: Date/Time Version:
Severity: minor Keywords: has-patch
Cc: Focuses:

Description

Core sets PHP timezone to UTC on boot and assumes it for Date/Time operations. Which we are in process of improving to eliminate reliance on this assumption in #44491

However there are also couple places in core where it changes PHP time zone back and forth for calculations:

  • in options to determine DST status
  • in PHPMailer (which I assume is just inherited from upstream)

We should get rid of these, calculations should not need to rely on manipulating global PHP configuration state.

Attachments (1)

settings-dst-detection.patch​ (973 bytes ) - added by Rarst 7 years ago.

Download all attachments as: .zip

Change History (5)

This ticket was mentioned in ​Slack in #core-datetime by rarst. ​View the logs.


8 years ago

#2 @Rarst
7 years ago

  • Keywords has-patch added; needs-patch removed

#3 @SergeyBiryukov
7 years ago

  • Milestone Awaiting Review → 5.3
  • Owner set to SergeyBiryukov
  • Status new → reviewing

#4 @SergeyBiryukov
7 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 45556:

Date/Time: Eliminate use of date_default_timezone_set() for determining DST status on General Options screen.

Time calculations should not need to rely on manipulating global PHP configuration state.

Props Rarst.
Fixes #46483.

Note: See TracTickets for help on using tickets.