Req #77672 [Opn->Fbk]: Add getOffset method to DateTimeInterface

From: Date: Wed, 27 Feb 2019 00:39:33 +0000
Subject: Req #77672 [Opn->Fbk]: Add getOffset method to DateTimeInterface
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219748@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77672&edit=1

 ID:                 77672
 Updated by:         requinix@php.net
 Reported by:        sites+php at dan dot cx
 Summary:            Add getOffset method to DateTimeInterface
-Status:             Open
+Status:             Feedback
 Type:               Feature/Change Request
 Package:            Date/time related
 PHP Version:        7.3.2
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2019-02-26 23:17:52] a at b dot c dot de

Um... it's already there?

------------------------------------------------------------------------
[2019-02-26 20:15:36] 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()



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=77672&edit=1


Thread (4 messages)

« previous php.bugs (#219748) next »