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

From: Date: Wed, 27 Feb 2019 00:45:40 +0000
Subject: Req #77672 [Fbk->Csd]: Add getOffset method to DateTimeInterface
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219749@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 User updated by: sites+php at dan dot cx Reported by: sites+php at dan dot cx Summary: Add getOffset method to DateTimeInterface -Status: Feedback +Status: Closed Type: Feature/Change Request Package: Date/time related PHP Version: 7.3.2 Block user comment: N Private report: N New Comment: You're right. My mistake... Not sure how I missed that. 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

« previous php.bugs (#219749) next »