php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #77672 Add getOffset method to DateTimeInterface
Submitted: 2019-02-26 20:15 UTC Modified: 2019-02-27 00:45 UTC
From: sites+php at dan dot cx Assigned:
Status: Closed Package: Date/time related
PHP Version: 7.3.2 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sites+php at dan dot cx
New email:
PHP Version: OS:

 

 [2019-02-26 20:15 UTC] sites+php at dan dot cx
Description:
------------
To get the timezone offset of a DateTime or DateTimeImmutable instance, you need to do this:

$date->getTimezone()->getOffset($date)

Please consider adding a `getOffset` method to `DateTimeInterface`, so this can be simplified to:

$date->getOffset()


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-02-26 23:17 UTC] a at b dot c dot de
Um... it's already there?
 [2019-02-27 00:39 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2019-02-27 00:45 UTC] sites+php at dan dot cx
-Status: Feedback +Status: Closed
 [2019-02-27 00:45 UTC] sites+php at dan dot cx
You're right. My mistake... Not sure how I missed that.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 01:01:30 2024 UTC