package org.bscl.common;

import org.bscl.common.date.DateUtil;
import org.junit.Test;

import java.awt.*;
import java.util.Date;

/**
 * <p/>
 * User : krisibm@163.com
 * Date: 2015/8/10
 * Time: 14:55
 */
public class DateTest {

    @Test
    public void test1() {

        Date date = DateUtil.parseDate("20150810145612", "yyyyMMddHHmmss");

        String dateStr = DateUtil.formatDate(date, "yyyy-MM-dd");
        String currentDate = DateUtil.getDateTimeStr();
        System.out.println(date);
        System.out.println(dateStr);
        System.out.println(currentDate);
        Date d = DateUtil.getPreMonth();

        System.out.println(DateUtil.formatDate(d, DateUtil.DATETIME_STR));

        Date date1 = DateUtil.getDate(-15);
        System.out.println(date1);
        Date date2 = DateUtil.getCurrentDayEndTime();
        System.out.println(date2);

        System.out.println(DateUtil.formatBeforeDate(new Date()));



    }
}

@@ -97,13 +97,21 @@
 ava.
-awt.*
+util.Calendar
 ;%0Aim
@@ -936,17 +936,556 @@
 e()));%0A%0A
-%0A
+        Date date3 = DateUtil.getDate(0);%0A        System.out.println(date3);%0A%0A        Calendar c = Calendar.getInstance();%0A        c.add(Calendar.DATE, -4);%0A        System.out.println(c.getTime());%0A%0A%0A        Calendar c3 = Calendar.getInstance();%0A        c3.add(Calendar.DATE, -3);%0A        Date d3 = new Date();%0A        boolean isBefore = c.getTime().before(c3.getTime());%0A        System.out.println(isBefore);%0A        boolean b1 = false, b2 = false, b3 = true;%0A%0A        if (b1 %7C%7C b2 %7C%7C b3) %7B%0A            System.out.println(%22ddd%22);%0A        %7D
 %0A    %7D%0A%7D

update date