presto-main/src/main/java/io/prestosql/operator/scalar/DateTimeFunctions.java/DateTimeFunctions/lastDayOfMonthFromDate
class DateTimeFunctions:    @Description("last day of the month of the given date")
    @ScalarFunction("last_day_of_month")
    @SqlType(StandardTypes.DATE)
    public static long lastDayOfMonthFromDate(@SqlType(StandardTypes.DATE) long date)
    {
        long millis = UTC_CHRONOLOGY.monthOfYear().roundCeiling(DAYS.toMillis(date)) - MILLISECONDS_IN_DAY;
        return MILLISECONDS.toDays(millis);
    }