获取当前月的最后一天的结束时间
@return
174455
public static Date getEndOfMonth() {
		DateTime d = DateTime.now();
		int y = d.getYear();
		int m = d.getMonthOfYear();
		return new DateTime(y, m, getDaysOfMonth(y, m), 23, 23, 59, 999)
				.toDate();
	}
1253803
public int getDayOfYear() {

        switch (this.month) {
            case 1:
                return this.dayOfMonth;
            case 2:
                return 31 + this.dayOfMonth;
            default:
                return (
                    DAY_OF_YEAR_PER_MONTH[this.month - 2]
                    + this.dayOfMonth
                    + (GregorianMath.isLeapYear(this.year) ? 1 : 0));
        }

    }
986179
public static int[] today() {
        Calendar today = Calendar.getInstance();
        int year = today.get(Calendar.YEAR);
        int month = today.get(Calendar.MONTH) + 1;
        int date = today.get(Calendar.DATE);
        return calElement(year, month, date);
    }
1163877
public Calendar getCalendar()
    {           // Get this field's value
        java.util.Date dateValue = (java.util.Date)this.getData();  // Get the physical data
        if (dateValue == null)
            return null;
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(dateValue);
        return calendar;
    }
104009
private static int tryParseMonth(String month, Locale locale) {
		Map<String, Integer> names = getMonthNames(locale);
		Integer r = names.get(month.toUpperCase());
		if (r != null) {
			return r;
		}
		return -1;
	}
1049927
public int getMonth()
    {
        Timestamp adjusted = this;

        if (this._offset != null) {
            if (this._offset.intValue() != 0) {
                adjusted = make_localtime();
            }
        }
        return adjusted._month;
    }
879038
public double[] getMeanMonthly () {
      // 
         // Provides a per-month mean of data (across all years for that month). 
         // e.g. 12 means returned- one for all days in January in all years, 
         //      one for all dats in Feb in all years, etc.
                
        // Advance through all data, and sum each month's value.
        int monthlyCount[]; //the number of entries per month
        double monthlySum[]; //the sum of the data per month
        double meanMonthly[]; // The mean value per month
        
        monthlyCount = new int[12]; // Just need count and sum for 12 months
        monthlySum = new double[12];
        meanMonthly = new double[12];
        
        // Init data to clear.
        for (int i=0; i<12; i++) { 
            monthlyCount[i] = 0;
            monthlySum[i] = 0;
            meanMonthly[i] = 0;
        }
       
        int totalCount = 0;
       
        for (int i=0; i<this.getNumData(); i++) {
            Date date = this.getDate(i);
            double data = this.getData(i);
            int month = -1;
            
            if (i > this.getNumDates()) {throw new IllegalArgumentException("No date for data #" + i);}
            
            // Get month data out of date.
            month = date.getMonth();
           
             if (month > 11) {throw new IllegalArgumentException("Month number data out of range: " + month);}
             
            // Add to appropriate sum.
            monthlyCount[month]++;
            monthlySum[month] +=data;
            totalCount++;
        }
       
        if (totalCount == 0) {throw new IllegalArgumentException("No data used in Mean Montly calculation.");}
       
        for (int i=0; i<12; i++) {
          meanMonthly[i] = monthlySum[i]/monthlyCount[i];
        }
       
        return meanMonthly;
       
       }
615906
public static Long getMonthLastDay() {
		cal.setTimeInMillis(System.currentTimeMillis());
		cal.set(Calendar.DATE, 1);
		cal.roll(Calendar.DATE, -1);
		return cal.getTimeInMillis();
	}
330635
private int getMonthLength(int year, int month) {
        int days = DAYS_IN_MONTH[month];
        if (month == FEBRUARY && isLeapYear(year)) {
            days++;
        }
        return days;
    }
469401
protected function getMonthlyOccurrences()
    {
        $startDate = clone $this->currentDate;

        $byDayResults = [];

        // Our strategy is to simply go through the byDays, advance the date to
        // that point and add it to the results.
        if ($this->byDay) {
            foreach ($this->byDay as $day) {
                $dayName = $this->dayNames[$this->dayMap[substr($day, -2)]];

                // Dayname will be something like 'wednesday'. Now we need to find
                // all wednesdays in this month.
                $dayHits = [];

                // workaround for missing 'first day of the month' support in hhvm
                $checkDate = new \DateTime($startDate->format('Y-m-1'));
                // workaround modify always advancing the date even if the current day is a $dayName in hhvm
                if ($checkDate->format('l') !== $dayName) {
                    $checkDate = $checkDate->modify($dayName);
                }

                do {
                    $dayHits[] = $checkDate->format('j');
                    $checkDate = $checkDate->modify('next '.$dayName);
                } while ($checkDate->format('n') === $startDate->format('n'));

                // So now we have 'all wednesdays' for month. It is however
                // possible that the user only really wanted the 1st, 2nd or last
                // wednesday.
                if (strlen($day) > 2) {
                    $offset = (int) substr($day, 0, -2);

                    if ($offset > 0) {
                        // It is possible that the day does not exist, such as a
                        // 5th or 6th wednesday of the month.
                        if (isset($dayHits[$offset - 1])) {
                            $byDayResults[] = $dayHits[$offset - 1];
                        }
                    } else {
                        // if it was negative we count from the end of the array
                        // might not exist, fx. -5th tuesday
                        if (isset($dayHits[count($dayHits) + $offset])) {
                            $byDayResults[] = $dayHits[count($dayHits) + $offset];
                        }
                    }
                } else {
                    // There was no counter (first, second, last wednesdays), so we
                    // just need to add the all to the list).
                    $byDayResults = array_merge($byDayResults, $dayHits);
                }
            }
        }

        $byMonthDayResults = [];
        if ($this->byMonthDay) {
            foreach ($this->byMonthDay as $monthDay) {
                // Removing values that are out of range for this month
                if ($monthDay > $startDate->format('t') ||
                $monthDay < 0 - $startDate->format('t')) {
                    continue;
                }
                if ($monthDay > 0) {
                    $byMonthDayResults[] = $monthDay;
                } else {
                    // Negative values
                    $byMonthDayResults[] = $startDate->format('t') + 1 + $monthDay;
                }
            }
        }

        // If there was just byDay or just byMonthDay, they just specify our
        // (almost) final list. If both were provided, then byDay limits the
        // list.
        if ($this->byMonthDay && $this->byDay) {
            $result = array_intersect($byMonthDayResults, $byDayResults);
        } elseif ($this->byMonthDay) {
            $result = $byMonthDayResults;
        } else {
            $result = $byDayResults;
        }
        $result = array_unique($result);
        sort($result, SORT_NUMERIC);

        // The last thing that needs checking is the BYSETPOS. If it's set, it
        // means only certain items in the set survive the filter.
        if (!$this->bySetPos) {
            return $result;
        }

        $filteredResult = [];
        foreach ($this->bySetPos as $setPos) {
            if ($setPos < 0) {
                $setPos = count($result) + ($setPos + 1);
            }
            if (isset($result[$setPos - 1])) {
                $filteredResult[] = $result[$setPos - 1];
            }
        }

        sort($filteredResult, SORT_NUMERIC);

        return $filteredResult;
    }
1115767
public CalendarMonth plus(Months months) {

        if (months.isEmpty()) {
            return this;
        }

        long value = this.year * 12L + this.month.getValue() - 1 + months.getAmount();
        int y = MathUtils.safeCast(MathUtils.floorDivide(value, 12));
        Month m = Month.valueOf(MathUtils.floorModulo(value, 12) + 1);
        return CalendarMonth.of(y, m);

    }
1127726
public Day getDayOfWeek()
   {
      Day result = null;
      if (!m_days.isEmpty())
      {
         result = m_days.iterator().next();
      }
      return result;
   }
354694
public static Integer getDayNumOfMonth(Date date) {

        if (date == null)
            return null;

        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);

        return calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
    }
210482
public static String getFirstDayOfMonth(Date date){
        Calendar   ca   =   Calendar.getInstance();
        ca.setTime(date);
        ca.set(Calendar.DAY_OF_MONTH,   1);
        Date   firstDate   =   ca.getTime();
        return dateToString(firstDate);
    }
608032
public static Date getCurrentDateTime() {
        java.util.Calendar calNow = java.util.Calendar.getInstance();
        java.util.Date dtNow = calNow.getTime();

        return dtNow;
    }
269510
public static int getMonthLength(@NotNull final Date date) {
		int year = get(date, Calendar.YEAR);
		int month = get(date, Calendar.MONTH);
		return getMonthLength(year, month);
	}
540163
public function getFrenchMonths() {
        $months = array(
            1 => 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'
        );
        return $months;
    }