src/Utility/DTZone.php
public static function offsetToUtc(DateTime $value) : DateTime
    {
        $result = $value;

        $dtz = $value->getTimezone();
        if ($dtz->getName() === 'UTC') {
            return $result;
        }

        $epoch = time();
        $transitions = $dtz->getTransitions($epoch, $epoch);

        $offset = $transitions[0]['offset'];
        $result = $result->modify("-$offset seconds");

        return $result;
    }
public static function offsetToUtc(DateTime $value) : DateTime
    {
        $result = $value;

        $dtz = $value->getTimezone();
        if ($dtz->getName() === 'UTC') {
            return $result;
        }

        $epoch = time();
        $transitions = $dtz->getTransitions($epoch, $epoch);

        $offset = $transitions[0]['offset'];
        $result = $result->modify("-$offset seconds");

        return $result;
    }
public static function offsetToUtc ( DateTime $ value ) : DateTime { $ result = $ value ; $ dtz = $ value -> getTimezone ( ) ; if ( $ dtz -> getName ( ) === 'UTC' ) { return $ result ; } $ epoch = time ( ) ; $ transitions = $ dtz -> getTransitions ( $ epoch , $ epoch ) ; $ offset = $ transitions [ 0 ] [ 'offset' ] ; $ result = $ result -> modify ( "-$offset seconds" ) ; return $ result ; }
Offset DateTime value to UTC

NOTE: This is a temporary work around until we fix our handling of
the application timezones.  Database values should always be
stored in UTC no matter what.  Otherwise, you will be riding
a bike which is on fire, while you are on fire, and everything
around you is on fire.  See Redmine ticket #4336 for details.

@param \DateTime $value DateTime value to offset
@return \DateTime
Offset DateTime value to UTC