Req #77672 [Com]: Add getOffset method to DateTimeInterface

From: Date: Tue, 26 Feb 2019 23:17:52 +0000
Subject: Req #77672 [Com]: Add getOffset method to DateTimeInterface
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219746@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 Comment by: a at b dot c dot de Reported by: sites+php at dan dot cx Summary: Add getOffset method to DateTimeInterface Status: Open Type: Feature/Change Request Package: Date/time related PHP Version: 7.3.2 Block user comment: N Private report: N New Comment: Um... it's already there? Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#219746) next »