@@ -0,0 +1,1452 @@
+package util;%0A%0Aimport java.util.Calendar;%0Aimport java.util.Date;%0A%0A/**%0A * %E6%97%A5%E4%BB%98%E3%81%AEUtil%E3%82%AF%E3%83%A9%E3%82%B9%0A * only Java STD class.%0A * @author pollseed%0A * %0A */%0A@JavaStandardVersion%0Apublic class DateUtils %7B%0A%0A    /**%0A     * %E7%8F%BE%E5%9C%A8%E5%B9%B4%E6%9C%88%E6%97%A5%E3%82%92%E8%BF%94%E5%8D%B4%E3%81%97%E3%81%BE%E3%81%99.%0A     * @return%0A     */%0A    public static Date now() %7B%0A        return new Date();%0A    %7D%0A%0A    /**%0A     * %E6%98%8E%E6%97%A5%E3%82%92%E8%BF%94%E5%8D%B4%E3%81%97%E3%81%BE%E3%81%99.%0A     * @return%0A     */%0A    public static Date yesterday() %7B%0A        return add(now(), -1);%0A    %7D%0A%0A    /**%0A     * %E6%98%A8%E6%97%A5%E3%82%92%E8%BF%94%E5%8D%B4%E3%81%97%E3%81%BE%E3%81%99.%0A     * @return%0A     */%0A    public static Date tomorrow() %7B%0A        return add(now(), +1);%0A    %7D%0A%0A    /**%0A     * %E6%8C%87%E5%AE%9A%E3%81%97%E3%81%9F%E6%97%A5%E4%BB%98%E3%81%8B%E3%82%89%E6%8C%87%E5%AE%9A%E3%81%97%E3%81%9F%E6%95%B0%E5%80%A4%E3%82%92%E5%8A%A0%E7%AE%97%E3%81%97%E3%81%BE%E3%81%99.%0A     * @param date%0A     * @param value%0A     * @return%0A     */%0A    protected static Date add(final Date date, final int value) %7B%0A        final Calendar cal = Calendar.getInstance();%0A        cal.setTime(date);%0A        cal.add(Calendar.DAY_OF_MONTH, value);%0A        return cal.getTime();%0A    %7D%0A%0A    /**%0A     * %E6%8C%87%E5%AE%9A%E3%81%97%E3%81%9F%E6%97%A5%E4%BB%98%E3%82%92%E6%AF%94%E8%BC%83%E3%81%97%E3%80%81%E3%81%9D%E3%81%AE%E5%B7%AE%E5%88%86%E3%82%92%E8%BF%94%E5%8D%B4%E3%81%97%E3%81%BE%E3%81%99.%0A     * @param one%0A     * @param another%0A     * @return%0A     */%0A    protected static Integer compare(final Date one, final Date another) %7B%0A        if (one == null %7C%7C another == null) %7B%0A            return null;%0A        %7D%0A        final Calendar cal1 = Calendar.getInstance();%0A        final Calendar cal2 = Calendar.getInstance();%0A        cal1.setTime(one);%0A        cal2.setTime(another);%0A        int age = Math.abs(cal1.get(Calendar.YEAR) - cal2.get(Calendar.YEAR));%0A        return cal1.getTime().before(cal2.getTime()) ? age-- : age;%0A    %7D%0A%0A%7D%0A

Create DateUtils.java