获取本月的第一天的时间戳
@return
516701
public static Long getMonth1stDay() {
		cal.setTimeInMillis(System.currentTimeMillis());
		cal.set(Calendar.DATE, 1);
		return cal.getTimeInMillis();
	}
432520
private Calendar getSortCalendar() {
        if (sortDate == null) {
            final DateParser parser = new DateParser(getDate());
            sortDate = parser.getSortCalendar();
        }
        return sortDate;
    }
935134
public static int getMonthFromDate(Date date) {
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		return cal.get(Calendar.MONTH) + 1;
	}
372896
function () {
    var date = new Date();
    var dateStr = '';
    var day = date.getDate();
    var month = date.getMonth();

    month = (month+'').length === 1 ? '0' + month : month;
    day = (day+'').length === 1 ? '0' + day : day;

    dateStr += month + '_';
    dateStr += day + '_';
    dateStr += date.getFullYear();

    return dateStr;
  }
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;
       
       }
349866
public static Month toMonth(final Calendar self) {
        return Month.of(self.get(Calendar.MONTH) + 1);
    }
187353
static int getMonthLength(int month, int year) {
      Integer[] newMonths = getAdjustedMonthLength(year);
      return newMonths[month].intValue();
    }
1311936
private void getMonthlyRelativeDates(Calendar calendar, int frequency, List<Date> dates)
   {
      long startDate = calendar.getTimeInMillis();
      calendar.set(Calendar.DAY_OF_MONTH, 1);
      int dayNumber = NumberHelper.getInt(m_dayNumber);

      while (moreDates(calendar, dates))
      {
         if (dayNumber > 4)
         {
            setCalendarToLastRelativeDay(calendar);
         }
         else
         {
            setCalendarToOrdinalRelativeDay(calendar, dayNumber);
         }

         if (calendar.getTimeInMillis() > startDate)
         {
            dates.add(calendar.getTime());
            if (!moreDates(calendar, dates))
            {
               break;
            }
         }
         calendar.set(Calendar.DAY_OF_MONTH, 1);
         calendar.add(Calendar.MONTH, frequency);
      }
   }
843735
public static PeriodType months() {
        PeriodType type = cMonths;
        if (type == null) {
            type = new PeriodType(
                "Months",
                new DurationFieldType[] { DurationFieldType.months() },
                new int[] { -1, 0, -1, -1, -1, -1, -1, -1, }
            );
            cMonths = type;
        }
        return type;
    }
330635
private int getMonthLength(int year, int month) {
        int days = DAYS_IN_MONTH[month];
        if (month == FEBRUARY && isLeapYear(year)) {
            days++;
        }
        return days;
    }
1302071
public String getFMDate() {
        Calendar cal = Calendar.getInstance();
        cal.setTime(this);
        StringBuilder sb = new StringBuilder(15);
        int hour = cal.get(Calendar.HOUR_OF_DAY);
        
        if (hour == 0 && hasTime) {
            hour = 24;
            cal.add(Calendar.DAY_OF_MONTH, -1);
        }
        
        addFMPiece(sb, cal.get(Calendar.YEAR) - 1700, 0);
        addFMPiece(sb, cal.get(Calendar.MONTH) + 1, 2);
        addFMPiece(sb, cal.get(Calendar.DAY_OF_MONTH), 2);
        
        if (hasTime) {
            sb.append('.');
            addFMPiece(sb, hour, 2);
            addFMPiece(sb, cal.get(Calendar.MINUTE), 2);
            addFMPiece(sb, cal.get(Calendar.SECOND), 2);
            addFMPiece(sb, cal.get(Calendar.MILLISECOND), 2);
            
            for (int i = sb.length() - 1; i >= 0; i--) {
                char c = sb.charAt(i);
                
                if (c == '0') {
                    sb.deleteCharAt(i);
                } else if (c == '.') {
                    sb.deleteCharAt(i);
                    break;
                } else {
                    break;
                }
            }
        }
        
        return sb.toString();
    }
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);
	}
438236
public static CalendarMonth from(YearMonth yearMonth) {

        return CalendarMonth.of(yearMonth.getYear(), yearMonth.getMonthValue());

    }
488081
function nextMonth() {
  if (calendar.m === 12) {
    calendar.m = 1;
    calendar.y += 1;
    calendar.d = 1;
  } else {
    calendar.m += 1;
    calendar.d = 1;
  }

  calendar.year = yearFactory.get(calendar.y);
}
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);

    }
1373720
public static Integer getDayOfMonth(Date date) {

        if (date == null)
            return null;

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

        return calendar.get(Calendar.DAY_OF_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;
    }