presto-main/src/main/java/io/prestosql/type/DateOperators.java/DateOperators/castToTimestamp
class DateOperators:    @ScalarOperator(CAST)
    @SqlType(StandardTypes.TIMESTAMP)
    public static long castToTimestamp(ConnectorSession session, @SqlType(StandardTypes.DATE) long value)
    {
        if (session.isLegacyTimestamp()) {
            long utcMillis = TimeUnit.DAYS.toMillis(value);

            // date is encoded as milliseconds at midnight in UTC
            // convert to midnight in the session timezone
            ISOChronology chronology = getChronology(session.getTimeZoneKey());
            return utcMillis - chronology.getZone().getOffset(utcMillis);
        }
        return TimeUnit.DAYS.toMillis(value);
    }