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

        return modulo24Hour(value);
    }