获取昨天20151230格式的int值

@return 20151230格式的int值
772398
public static int yesterday() {
        Calendar cal = Calendar.getInstance();
        cal.add(Calendar.DAY_OF_YEAR, -1);
        return cal.get(Calendar.YEAR) * 10000 + (cal.get(Calendar.MONTH) + 1) * 100 + cal.get(Calendar.DAY_OF_MONTH);
    }
957405
private static int getYearInCycle(int cycleNumber, long dayOfCycle) {
        Integer[] cycles = getAdjustedCycle(cycleNumber);
        if (dayOfCycle == 0) {
            return 0;
        }

        if (dayOfCycle > 0) {
            for (int i = 0; i < cycles.length; i++) {
                if (dayOfCycle < cycles[i].intValue()) {
                    return i - 1;
                }
            }
            return 29;
        } else {
            dayOfCycle = -dayOfCycle;
            for (int i = 0; i < cycles.length; i++) {
                if (dayOfCycle <= cycles[i].intValue()) {
                    return i - 1;
                }
            }
            return 29;
        }
    }
964990
public int getDays() {
		switch (_units) {
		case Days:
			return _amount;
		case Weeks:
			return _amount * 7;
		case Months:
			if (_amount <= 1)
				return _amount * 30;
			else if (_amount < 12)
				return (_amount * 61) / 2;
			else
				return (_amount * 365) / 12;
		default:
			throw new UnsupportedOperationException();
		}
	}
300760
int getDaysInMonthMax(long instant) {
        int thisYear = getYear(instant);
        int thisMonth = getMonthOfYear(instant, thisYear);
        return getDaysInYearMonth(thisYear, thisMonth);
    }
993082
public function int()
    {
        return $this->markErrorIf(!is_numeric($this->value) || strval(intval($this->value)) != strval($this->value) );
    }
43886
public Calendar calendarValue()
    {
        Calendar cal = new GregorianCalendar(_Private_Utils.UTC);

        long millis = getMillis();
        Integer offset = _offset;
        if (offset != null && offset != 0)
        {
            int offsetMillis = offset * 60 * 1000;
            millis += offsetMillis;
            cal.setTimeInMillis(millis);                // Resets the offset!
            cal.set(Calendar.ZONE_OFFSET, offsetMillis);
        }
        else
        {
            cal.setTimeInMillis(millis);
        }

        switch (_precision) {
            case YEAR:
                cal.clear(Calendar.MONTH);
            case MONTH:
                cal.clear(Calendar.DAY_OF_MONTH);
            case DAY:
                cal.clear(Calendar.HOUR_OF_DAY);
                cal.clear(Calendar.MINUTE);
            case MINUTE:
                cal.clear(Calendar.SECOND);
                cal.clear(Calendar.MILLISECOND);
            case SECOND:
                if (_fraction == null) {
                    cal.clear(Calendar.MILLISECOND);
                }
        }

        return cal;
    }
399362
public int getUnsignedMediumInt() {
        int b1 = getUnsigned();
        int b2 = getUnsigned();
        int b3 = getUnsigned();
        if (_isBigEndian) {
            return (b1<<16) | (b2<<8) | b3;
        }
        else {
            return (b3<<16) | (b2<<8) | b1;
        }
    }
479703
function time(): int {
        if($this->nativeHrtime) {
            if(!$this->lastTime) {
                $this->lastTime = $this->timer;
            }
            
            $time = \hrtime(true);
            $elapsed = (int) ($time - $this->lastTime);
            $this->lastTime = $time;
        } elseif($this->hrtime) {
            $this->timer->stop();
            $elapsed = (int) $this->timer->getLastElapsedTime(\HRTime\Unit::NANOSECOND);
            $this->timer->start();
        } else {
            if(!$this->lastTime) {
                $this->lastTime = $this->timer;
            }
            
            $time = \microtime(true);
            $elapsed = $time - $this->lastTime;
            
            $this->lastTime = $time;
            $elapsed = \ceil(($elapsed * 1000000000));
        }
        
        return ((int) $elapsed);
    }
89990
public int numChars() {
    int len = 0;
    for (int i = 0; i < numBytes; i += numBytesForFirstByte(getByte(i))) {
      len += 1;
    }
    return len;
  }
67965
public int getSeconds() {
		// TODO ahai 未做测试
		Calendar cld = Calendar.getInstance();
		cld.set(Calendar.DAY_OF_WEEK, this.weekday + 1);
		cld.set(Calendar.HOUR_OF_DAY, this.hour);
		cld.set(Calendar.MINUTE, this.minute);
		cld.set(Calendar.SECOND, this.second);
		long time = cld.getTimeInMillis();
		// System.out.println("time:" +
		// DateUtil.getTime(DateUtil.toDate(time)));
		long diff = time - System.currentTimeMillis();
		if (diff <= 0) {// 一定要小于等于0
			// 本周的时间已过，下周再执行
			diff += 7 * 24 * 60 * 60 * 1000L;
		}
		int seconds = (int) (diff / 1000);
		return seconds;
	}
403325
synchronized public long getValue() {

        if (limitReached) {
            throw Error.error(ErrorCode.X_2200H);
        }

        long nextValue;

        if (increment > 0) {
            if (currValue > maxValue - increment) {
                if (isCycle) {
                    nextValue = minValue;
                } else {
                    limitReached = true;
                    nextValue    = minValue;
                }
            } else {
                nextValue = currValue + increment;
            }
        } else {
            if (currValue < minValue - increment) {
                if (isCycle) {
                    nextValue = maxValue;
                } else {
                    limitReached = true;
                    nextValue    = minValue;
                }
            } else {
                nextValue = currValue + increment;
            }
        }

        long result = currValue;

        currValue = nextValue;

        return result;
    }
634093
public synchronized long nextId() {
		long timestamp = genTime();
		if (timestamp < lastTimestamp) {
			// 如果服务器时间有问题(时钟后退) 报错。
			throw new IllegalStateException(StrUtil.format("Clock moved backwards. Refusing to generate id for {}ms", lastTimestamp - timestamp));
		}
		if (lastTimestamp == timestamp) {
			sequence = (sequence + 1) & sequenceMask;
			if (sequence == 0) {
				timestamp = tilNextMillis(lastTimestamp);
			}
		} else {
			sequence = 0L;
		}

		lastTimestamp = timestamp;

		return ((timestamp - twepoch) << timestampLeftShift) | (datacenterId << datacenterIdShift) | (workerId << workerIdShift) | sequence;
	}
560178
public Integer getDay() {
		String dateValue = getValue();

		if (dateValue != null && dateValue.length() == DAY_END) {
			return parseDateComponent(dateValue.substring(DAY_START, DAY_END), getPaddingChar());
		} else {
			return null;
		}
	}
1162508
public int getDayOfYear() {

        int doy = this.iso.get(PlainDate.DAY_OF_YEAR);

        if (this.iso.getYear() < 1941) {
            if (this.iso.getMonth() >= 4) {
                doy -= (this.iso.isLeapYear() ? 91 : 90);
            } else {
                doy += 275; // 91 + 92 + 92
            }
        }

        return doy;

    }
516701
public static Long getMonth1stDay() {
		cal.setTimeInMillis(System.currentTimeMillis());
		cal.set(Calendar.DATE, 1);
		return cal.getTimeInMillis();
	}
238453
public String toStringRfc3339() {
    StringBuilder sb = new StringBuilder();
    Calendar dateTime = new GregorianCalendar(GMT);
    long localTime = value + (tzShift * 60000L);
    dateTime.setTimeInMillis(localTime);
    // date
    appendInt(sb, dateTime.get(Calendar.YEAR), 4);
    sb.append('-');
    appendInt(sb, dateTime.get(Calendar.MONTH) + 1, 2);
    sb.append('-');
    appendInt(sb, dateTime.get(Calendar.DAY_OF_MONTH), 2);
    if (!dateOnly) {
      // time
      sb.append('T');
      appendInt(sb, dateTime.get(Calendar.HOUR_OF_DAY), 2);
      sb.append(':');
      appendInt(sb, dateTime.get(Calendar.MINUTE), 2);
      sb.append(':');
      appendInt(sb, dateTime.get(Calendar.SECOND), 2);

      if (dateTime.isSet(Calendar.MILLISECOND)) {
        sb.append('.');
        appendInt(sb, dateTime.get(Calendar.MILLISECOND), 3);
      }
      // time zone
      if (tzShift == 0) {
        sb.append('Z');
      } else {
        int absTzShift = tzShift;
        if (tzShift > 0) {
          sb.append('+');
        } else {
          sb.append('-');
          absTzShift = -absTzShift;
        }

        int tzHours = absTzShift / 60;
        int tzMinutes = absTzShift % 60;
        appendInt(sb, tzHours, 2);
        sb.append(':');
        appendInt(sb, tzMinutes, 2);
      }
    }
    return sb.toString();
  }
211321
public function getTimestamp() : ?int 
    {
        if ( ! $this->hasTimestamp()) {
            $this->setTimestamp($this->getDefaultTimestamp());
        }
        return $this->timestamp;
    }