presto-main/src/main/java/io/prestosql/type/TimestampWithTimeZoneOperators.java/TimestampWithTimeZoneOperators/castToTime
class TimestampWithTimeZoneOperators:    @ScalarOperator(CAST)
    @SqlType(StandardTypes.TIME)
    public static long castToTime(ConnectorSession session, @SqlType(StandardTypes.TIMESTAMP_WITH_TIME_ZONE) long value)
    {
        if (session.isLegacyTimestamp()) {
            return modulo24Hour(unpackChronology(value), unpackMillisUtc(value));
        }

        return modulo24Hour(castToTimestamp(session, value));
    }