presto-main/src/main/java/io/prestosql/type/TimestampOperators.java/TimestampOperators/castToTimeWithTimeZone
class TimestampOperators:    @ScalarOperator(CAST)
    @SqlType(StandardTypes.TIME_WITH_TIME_ZONE)
    public static long castToTimeWithTimeZone(ConnectorSession session, @SqlType(StandardTypes.TIMESTAMP) long value)
    {
        if (session.isLegacyTimestamp()) {
            int timeMillis = modulo24Hour(getChronology(session.getTimeZoneKey()), value);
            return packDateTimeWithZone(timeMillis, session.getTimeZoneKey());
        }

        ISOChronology localChronology = getChronology(session.getTimeZoneKey());
        // This cast does treat TIMESTAMP as wall time in session TZ. This means that in order to get
        // its UTC representation we need to shift the value by the offset of TZ.
        return packDateTimeWithZone(localChronology.getZone().convertLocalToUTC(modulo24Hour(value), false), session.getTimeZoneKey());
    }