presto-main/src/main/java/io/prestosql/operator/scalar/DateTimeFunctions.java/DateTimeFunctions/lastDayOfMonthFromTimestamp
class DateTimeFunctions:    @Description("last day of the month of the given timestamp")
    @ScalarFunction("last_day_of_month")
    @SqlType(StandardTypes.DATE)
    public static long lastDayOfMonthFromTimestamp(ConnectorSession session, @SqlType(StandardTypes.TIMESTAMP) long timestamp)
    {
        if (session.isLegacyTimestamp()) {
            long millis = getChronology(session.getTimeZoneKey()).monthOfYear().roundCeiling(timestamp) - MILLISECONDS_IN_DAY;
            return MILLISECONDS.toDays(millis);
        }
        long millis = UTC_CHRONOLOGY.monthOfYear().roundCeiling(timestamp) - MILLISECONDS_IN_DAY;
        return MILLISECONDS.toDays(millis);
    }