php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #44726 date_timezone_set function feature request
Submitted: 2008-04-14 19:40 UTC Modified: 2008-04-15 00:15 UTC
From: danik at mit dot edu Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2CVS-2008-04-14 (snap) OS: centos4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: danik at mit dot edu
New email:
PHP Version: OS:

 

 [2008-04-14 19:40 UTC] danik at mit dot edu
Description:
------------
Dear Derick and Date Developers,

First of all, thank you adding timezone and dst support to PHP.  I'm so glad that I don't have to write this class myself and deal with maintaining the backend.

I would like to request automatic dst handling for the DateTime object.

Currently, there is no automatic way to apply a timezone dst offset to the DateTime object.  I'm in the process of writing code that iterates through the timezone transitions array, similar to the sample code from your 2007 talk.

I would love to refactor my code to use a call like this:

void date_timezone_set( 
    DateTime $object,
    DateTimeZone $timezone,
    [, int $apply_dst_offset]
)

Similarly, the date_create function could also take the same optional argument.

Please let me know if this realistic.

Thank you for your time,
Dan


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-04-15 00:15 UTC] scottmac@php.net
DST is automatically taken into account by the date functions, that's why you define the location and not just a particular offset.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 03 04:00:02 2025 UTC