java 日期工具类_java8实现的处理时间工具类(收藏)

这个Java类库提供了一系列静态方法,用于处理和格式化Java 8的日期和时间API,如LocalDateTime, LocalDate等。它包括获取当前日期、时间,转换日期格式,计算日期差值,以及进行日期偏移操作等功能。
摘要由CSDN通过智能技术生成

packagecom.drew.util;importjava.time.DayOfWeek;importjava.time.LocalDate;importjava.time.LocalDateTime;importjava.time.LocalTime;importjava.time.MonthDay;importjava.time.Period;importjava.time.format.DateTimeFormatter;importjava.time.format.FormatStyle;importjava.time.temporal.ChronoUnit;importjava.time.temporal.TemporalAdjusters;importjava.util.List;importcom.google.common.collect.Lists;/***

* java1.8 的新特性,解决SimpleDateFormat的线程问题

*

Instant代替 Date,

*

LocalDateTime代替 Calendar,

*

DateTimeFormatter 代替 SimpleDateFormat. 注意:如果是共享变量,则可能会出现线程问题。

*

*@authorzero 2019/03/30*/

public classDateUtil8 {//时间元素

private static final String YEAR = "year";private static final String MONTH = "month";private static final String WEEK = "week";private static final String DAY = "day";private static final String HOUR = "hour";private static final String MINUTE = "minute";private static final String SECOND = "second";//星期元素

private static final String MONDAY = "MONDAY";//星期一

private static final String TUESDAY = "TUESDAY";//星期二

private static final String WEDNESDAY = "WEDNESDAY";//星期三

private static final String THURSDAY = "THURSDAY";//星期四

private static final String FRIDAY = "FRIDAY";//星期五

private static final String SATURDAY = "SATURDAY";//星期六

private static final String SUNDAY = "SUNDAY";//星期日//根据指定格式显示日期和时间

/**yyyy-MM-dd*/

private static final DateTimeFormatter yyyyMMdd_EN = DateTimeFormatter.ofPattern("yyyy-MM-dd");/**yyyy-MM-dd HH*/

private static final DateTimeFormatter yyyyMMddHH_EN = DateTimeFormatter.ofPattern("yyyy-MM-dd HH");/**yyyy-MM-dd HH:mm*/

private static final DateTimeFormatter yyyyMMddHHmm_EN = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");/**yyyy-MM-dd HH:mm:ss*/

private static final DateTimeFormatter yyyyMMddHHmmss_EN = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");/**HH:mm:ss*/

private static final DateTimeFormatter HHmmss_EN = DateTimeFormatter.ofPattern("HH:mm:ss");/**yyyy年MM月dd日*/

private static final DateTimeFormatter yyyyMMdd_CN = DateTimeFormatter.ofPattern("yyyy年MM月dd日");/**yyyy年MM月dd日HH时*/

private static final DateTimeFormatter yyyyMMddHH_CN = DateTimeFormatter.ofPattern("yyyy年MM月dd日HH时");/**yyyy年MM月dd日HH时mm分*/

private static final DateTimeFormatter yyyyMMddHHmm_CN = DateTimeFormatter.ofPattern("yyyy年MM月dd日HH时mm分");/**yyyy年MM月dd日HH时mm分ss秒*/

private static final DateTimeFormatter yyyyMMddHHmmss_CN = DateTimeFormatter.ofPattern("yyyy年MM月dd日HH时mm分ss秒");/**HH时mm分ss秒*/

private static final DateTimeFormatter HHmmss_CN = DateTimeFormatter.ofPattern("HH时mm分ss秒");//本地时间显示格式:区分中文和外文显示

private static final DateTimeFormatter shotDate =DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT);private static final DateTimeFormatter fullDate =DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL);private static final DateTimeFormatter longDate =DateTimeFormatter.ofLocalizedDate(FormatStyle.LONG);private static final DateTimeFormatter mediumDate =DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM);/*** 获取当前日期

*

*@returnyyyy-MM-dd

*@authorzero 2019/03/30*/

public staticString getNowDate_EN() {returnString.valueOf(LocalDate.now());

}/*** 获取当前日期

*

*@return字符串yyyy-MM-dd HH:mm:ss

*@authorzero 2019/03/30*/

public staticString getNowTime_EN() {returnLocalDateTime.now().format(yyyyMMddHHmmss_EN);

}/**获取当前时间(yyyy-MM-dd HH)*/

public staticString getNowTime_EN_yMdH() {returnLocalDateTime.now().format(yyyyMMddHH_EN);

}/**获取当前时间(yyyy年MM月dd日)*/

public staticString getNowTime_CN_yMdH() {returnLocalDateTime.now().format(yyyyMMddHH_CN);

}/**获取当前时间(yyyy-MM-dd HH:mm)*/

public staticString getNowTime_EN_yMdHm() {returnLocalDateTime.now().format(yyyyMMddHHmm_EN);

}/**获取当前时间(yyyy年MM月dd日HH时mm分)*/

public staticString getNowTime_CN_yMdHm() {returnLocalDateTime.now().format(yyyyMMddHHmm_CN);

}/**获取当前时间(HH时mm分ss秒)*/

public staticString getNowTime_CN_HHmmss() {returnLocalDateTime.now().format(HHmmss_CN);

}/*** 根据日期格式,获取当前时间

*

*@paramformatStr 日期格式

*

yyyy

*

yyyy-MM-dd

*

yyyy-MM-dd HH:mm:ss

*

HH:mm:ss

*@return*@authorzero 2019/03/30*/

public staticString getTime(String formatStr) {returnLocalDateTime.now().format(DateTimeFormatter.ofPattern(formatStr));

}/*** 获取中文的当前日期

*

*@returnyyyy年mm月dd日

*@authorzero 2019/03/30*/

public staticString getNowDate_CN() {returnLocalDate.now().format(yyyyMMdd_CN);

}/*** 获取中文当前时间

*

*@returnyyyy年MM月dd日HH时mm分ss秒

*@authorzero 2019/03/30*/

public staticString getNowTime_CN() {returnLocalDateTime.now().format(yyyyMMddHHmmss_CN);

}/*** 简写本地当前日期:yy-M-dd

* 例如:19-3-30为2019年3月30日

*

*@return字符串yy-M-dd

*@authorzero 2019/03/30*/

public staticString getNowLocalTime_shot() {returnLocalDateTime.now().format(shotDate);

}/*** 根据当地日期显示格式:yyyy年M月dd日 星期?(中国)

*

*@return形如:2019年3月30日 星期六

*@authorzero 2019/03/30*/

public staticString getNowLocalTime_full() {returnLocalDateTime.now().format(fullDate);

}/*** 根据当地显示日期格式:yyyy年M月dd日(中国)

*

*@return形如 2019年3月30日

*@authorzero 2019/03/30*/

public staticString getNowLocalTime_long() {returnLocalDateTime.now().format(longDate);

}/*** 根据当地显示日期格式:yyyy-M-dd(中国)

*

*@return形如:2019-3-30

*@authorzero 2019/03/30*/

public staticString getNowLocalTime_medium() {returnLocalDateTime.now().format(mediumDate);

}/*** 获取当前日期的节点时间(年,月,周,日,时,分,秒)

*

*@paramnode 日期中的节点元素(年,月,周,日,时,分,秒)

*@return节点数字,如创建此方法的时间:年 2019,月 3,日 30,周 6

*@authorzero 2019/03/30 星期六*/

public staticInteger getNodeTime(String node) {

LocalDateTime today=LocalDateTime.now();

Integer resultNode= null;switch(node) {caseYEAR:

resultNode=today.getYear();break;caseMONTH:

resultNode=today.getMonthValue();break;caseWEEK:

resultNode=transformWeekEN2Num(String.valueOf(today.getDayOfWeek()));break;caseDAY:

resultNode=today.getDayOfMonth();break;caseHOUR:

resultNode=today.getHour();break;caseMINUTE:

resultNode=today.getMinute();break;caseSECOND:

resultNode=today.getSecond();break;default://当前日期是当前年的第几天。例如:2019/1/3是2019年的第三天

resultNode =today.getDayOfYear();break;

}returnresultNode;

}/*** 将英文星期转换成数字

*

*@paramenWeek 英文星期

*@returnint,如果数字小于0,则检查,看是否输入错误 or 入参为null

*@authorzero 2019/03/30*/

public static inttransformWeekEN2Num(String enWeek) {if(MONDAY.equals(enWeek)) {return 1;

}else if(TUESDAY.equals(enWeek)) {return 2;

}else if(WEDNESDAY.equals(enWeek)) {return 3;

}else if(THURSDAY.equals(enWeek)) {return 4;

}else if(FRIDAY.equals(enWeek)) {return 5;

}else if(SATURDAY.equals(enWeek)) {return 6;

}else if(SUNDAY.equals(enWeek)) {return 7;

}else{return -1;

}

}/*** 获取当前日期之后(之后)的节点事件

*

* 比如当前时间为:2019-03-30 10:20:30

*

*

node="hour",num=5L:2019-03-30 15:20:30

*

node="day",num=1L:2019-03-31 10:20:30

*

node="year",num=1L:2020-03-30 10:20:30

*

*@paramnode 节点元素(“year”,"month","week","day","huor","minute","second")

*@paramnum 第几天(+:之后,-:之前)

*@return之后或之后的日期

*@authorzero 2019/03/30*/

public staticString getAfterOrPreNowTime(String node, Long num) {

LocalDateTime now=LocalDateTime.now();if(HOUR.equals(node)) {returnnow.plusHours(num).format(yyyyMMddHHmmss_EN);

}else if(DAY.equals(node)) {returnnow.plusDays(num).format(yyyyMMddHHmmss_EN);

}else if(WEEK.equals(node)) {returnnow.plusWeeks(num).format(yyyyMMddHHmmss_EN);

}else if(MONTH.equals(node)) {returnnow.plusMonths(num).format(yyyyMMddHHmmss_EN);

}else if(YEAR.equals(node)) {returnnow.plusYears(num).format(yyyyMMddHHmmss_EN);

}else if(MINUTE.equals(node)) {returnnow.plusMinutes(num).format(yyyyMMddHHmmss_EN);

}else if(SECOND.equals(node)) {returnnow.plusSeconds(num).format(yyyyMMddHHmmss_EN);

}else{return "Node is Error!";

}

}/*** 获取与当前日期相距num个之后(之前)的日期

*

* 比如当前时间为:2019-03-30 10:20:30的格式日期

*

node="hour",num=5L:2019-03-30 15:20:30

*

node="day",num=1L:2019-03-31 10:20:30

*

node="year",num=1L:2020-03-30 10:20:30

*

*

*@paramdtf 格式化当前时间格式(dtf = yyyyMMddHHmmss_EN)

*@paramnode 节点元素(“year”,"month","week","day","huor","minute","second")

*@paramnum (+:之后,-:之前)

*@return之后之前的日期

*@authorzero 2019/03/30*/

public staticString getAfterOrPreNowTimePlus(DateTimeFormatter dtf, String node, Long num) {

LocalDateTime now=LocalDateTime.now();if(HOUR.equals(node)) {returnnow.plusHours(num).format(dtf);

}else if(DAY.equals(node)) {returnnow.plusDays(num).format(dtf);

}else if(WEEK.equals(node)) {returnnow.plusWeeks(num).format(dtf);

}else if(MONTH.equals(node)) {returnnow.plusMonths(num).format(dtf);

}else if(YEAR.equals(node)) {returnnow.plusYears(num).format(dtf);

}else if(MINUTE.equals(node)) {returnnow.plusMinutes(num).format(dtf);

}else if(SECOND.equals(node)) {returnnow.plusSeconds(num).format(dtf);

}else{return "Node is Error!";

}

}/*** 当前时间的hour,minute,second之后(之前)的时刻

*

*@paramnode 时间节点元素(hour,minute,second)

*@paramnum 之后(之后)多久时,分,秒(+:之后,-:之前)

*@returnHH:mm:ss 字符串

*@authorzero 2019/03/30*/

public staticString getAfterOrPreNowTimeSimp(String node, Long num) {

LocalTime now=LocalTime.now();if(HOUR.equals(node)) {returnnow.plusHours(num).format(HHmmss_EN);

}else if(MINUTE.equals(node)) {returnnow.plusMinutes(num).format(HHmmss_EN);

}else if(SECOND.equals(node)) {returnnow.plusSeconds(num).format(HHmmss_EN);

}else{return "Node is Error!";

}

}/*** 检查重复事件,比如生日。TODO This is a example.

*

*@parambirthDayStr

*@return*@authorzero 2019/03/31*/

public static boolean isBirthday(int month, intdayOfMonth) {

MonthDay birthDay=MonthDay.of(month, dayOfMonth);

MonthDay curMonthDay= MonthDay.from(LocalDate.now());//MonthDay只存储了月、日。

if(birthDay.equals(curMonthDay)) {return true;

}return false;

}/*** 获取当前日期第index日之后(之前)的日期(yyyy-MM-dd)

*

*@paramindex 第index天

*@return日期字符串:yyyy-MM-dd

*@authorzero 2019/03/31*/

public static String getAfterOrPreDayDate(intindex) {returnLocalDate.now().plus(index, ChronoUnit.DAYS).format(yyyyMMdd_EN);

}/*** 获取当前日期第index周之前(之后)的日期(yyyy-MM-dd)

*

*@paramindex 第index周(+:之后,-:之前)

*@return日期字符串:yyyy-MM-dd

*@authorzero 2019/03/31*/

public static String getAfterOrPreWeekDate(intindex) {returnLocalDate.now().plus(index, ChronoUnit.WEEKS).format(yyyyMMdd_EN);

}/*** 获取当前日期第index月之前(之后)的日期(yyyy-MM-dd)

*

*@paramindex 第index月(+:之后,-:之前)

*@return日期字符串:yyyy-MM-dd

*@authorzero 2019/03/31*/

public static String getAfterOrPreMonthDate(intindex) {returnLocalDate.now().plus(index, ChronoUnit.MONTHS).format(yyyyMMdd_EN);

}/*** 获取当前日期第index年之前(之后)的日期(yyyy-MM-dd)

*

*@paramindex 第index年(+:之后,-:之前)

*@return日期字符串:yyyy-MM-dd

*@authorzero 2019/03/31*/

public static String getAfterOrPreYearDate(intindex) {returnLocalDate.now().plus(index, ChronoUnit.YEARS).format(yyyyMMdd_EN);

}/*** 获取指定日期之前之后的第index的日,周,月,年的日期

*

*@paramdate 指定日期格式:yyyy-MM-dd

*@paramnode 时间节点元素(日周月年)

*@paramindex 之前之后第index个日期

*@returnyyyy-MM-dd 日期字符串

*@authorzero 2019/03/31*/

public static String getAfterOrPreDate(String date, String node, intindex) {

date=date.trim();if(DAY.equals(node)) {returnLocalDate.parse(date).plus(index, ChronoUnit.DAYS).format(yyyyMMdd_EN);

}else if(WEEK.equals(node)) {returnLocalDate.parse(date).plus(index, ChronoUnit.WEEKS).format(yyyyMMdd_EN);

}else if(MONTH.equals(node)) {returnLocalDate.parse(date).plus(index, ChronoUnit.MONTHS).format(yyyyMMdd_EN);

}else if(YEAR.equals(node)) {returnLocalDate.parse(date).plus(index, ChronoUnit.YEARS).format(yyyyMMdd_EN);

}else{return "Wrong date format!";

}

}/*** 检测:输入年份是否是闰年?

*

*@paramdate 日期格式:yyyy-MM-dd

*@returntrue:闰年,false:平年

*@authorzero 2019/03/31*/

public static booleanisLeapYear(String date) {returnLocalDate.parse(date.trim()).isLeapYear();

}/*** 计算两个日期字符串之间相差多少个周期(天,月,年)

*

*@paramdate1 yyyy-MM-dd

*@paramdate2 yyyy-MM-dd

*@paramnode 三者之一:(day,month,year)

*@return相差多少周期

*@authorzero 2019/03/31*/

public static intperidCount(String date1, String date2, String node) {

date1=date1.trim();

date2=date2.trim();if(DAY.equals(node)) {returnPeriod.between(LocalDate.parse(date1), LocalDate.parse(date2)).getDays();

}else if(MONTH.equals(node)) {returnPeriod.between(LocalDate.parse(date1), LocalDate.parse(date2)).getMonths();

}else if(YEAR.equals(node)) {returnPeriod.between(LocalDate.parse(date1), LocalDate.parse(date2)).getYears();

}else{return 0;

}

}/*** 切割日期。按照周期切割成小段日期段。例如:

*

*@paramstartDate 开始日期(yyyy-MM-dd)

*@paramendDate 结束日期(yyyy-MM-dd)

*@paramperiod 周期(天,周,月,年)

*@return切割之后的日期集合

*@authorzero 2019/04/02

* @example

*

startDate="2019-02-28",endDate="2019-03-05",period="day"

*

结果为:[2019-02-28, 2019-03-01, 2019-03-02, 2019-03-03, 2019-03-04, 2019-03-05]

*

startDate="2019-02-28",endDate="2019-03-25",period="week"

*

结果为:[2019-02-28,2019-03-06, 2019-03-07,2019-03-13, 2019-03-14,2019-03-20,

* 2019-03-21,2019-03-25]

*

startDate="2019-02-28",endDate="2019-05-25",period="month"

*

结果为:[2019-02-28,2019-02-28, 2019-03-01,2019-03-31, 2019-04-01,2019-04-30,

* 2019-05-01,2019-05-25]

*

startDate="2019-02-28",endDate="2020-05-25",period="year"

*

结果为:[2019-02-28,2019-12-31, 2020-01-01,2020-05-25]
*/

public static ListgetPieDateRange(String startDate, String endDate, String period) {

List result =Lists.newArrayList();

LocalDate end=LocalDate.parse(endDate, yyyyMMdd_EN);

LocalDate start=LocalDate.parse(startDate, yyyyMMdd_EN);

LocalDate tmp=start;switch(period) {caseDAY:while (start.isBefore(end) ||start.isEqual(end)) {

result.add(start.toString());

start= start.plusDays(1);

}break;caseWEEK:while (tmp.isBefore(end) ||tmp.isEqual(end)) {if (tmp.plusDays(6).isAfter(end)) {

result.add(tmp.toString()+ "," +end);

}else{

result.add(tmp.toString()+ "," + tmp.plusDays(6));

}

tmp= tmp.plusDays(7);

}break;caseMONTH:while (tmp.isBefore(end) ||tmp.isEqual(end)) {

LocalDate lastDayOfMonth=tmp.with(TemporalAdjusters.lastDayOfMonth());if(lastDayOfMonth.isAfter(end)) {

result.add(tmp.toString()+ "," +end);

}else{

result.add(tmp.toString()+ "," +lastDayOfMonth);

}

tmp= lastDayOfMonth.plusDays(1);

}break;caseYEAR:while (tmp.isBefore(end) ||tmp.isEqual(end)) {

LocalDate lastDayOfYear=tmp.with(TemporalAdjusters.lastDayOfYear());if(lastDayOfYear.isAfter(end)) {

result.add(tmp.toString()+ "," +end);

}else{

result.add(tmp.toString()+ "," +lastDayOfYear);

}

tmp= lastDayOfYear.plusDays(1);

}break;default:break;

}returnresult;

}/*** 指定日期月的最后一天(yyyy-MM-dd)

*

*@paramcurDate 日期格式(yyyy-MM-dd)

*@paramfirstOrLast true:第一天,false:最后一天

*@return*@authorzero 2019/04/13*/

public static String getLastDayOfMonth(String curDate, booleanfirstOrLast) {if(firstOrLast) {returnLocalDate.parse(curDate, yyyyMMdd_EN).with(TemporalAdjusters.firstDayOfMonth()).toString();

}else{returnLocalDate.parse(curDate, yyyyMMdd_EN).with(TemporalAdjusters.lastDayOfMonth()).toString();

}

}/*** 指定日期年的最后一天(yyyy-MM-dd)

*

*@paramcurDate 指定日期(格式:yyyy-MM-dd)

*@paramfirstOrLast true:第一天,false:最后一天

*@return*@authorzero 2019/04/13*/

public static String getLastDayOfYear(String curDate, booleanfirstOrLast) {if(firstOrLast) {returnLocalDate.parse(curDate, yyyyMMdd_EN).with(TemporalAdjusters.firstDayOfYear()).toString();

}else{returnLocalDate.parse(curDate, yyyyMMdd_EN).with(TemporalAdjusters.lastDayOfYear()).toString();

}

}/*** 获取下一个星期的日期

*

*@paramcurDay yyyy-MM-dd

*@paramdayOfWeek monday:1~sunday:7

*@paramisContainCurDay 是否包含当天,true:是,false:不包含

*@return日期(yyyy-MM-dd)

*@authorzero 2019/04/02*/

public static String getNextWeekDate(String curDay, int dayOfWeek, booleanisContainCurDay) {

dayOfWeek= dayOfWeek < 1 || dayOfWeek > 7 ? 1: dayOfWeek;if(isContainCurDay) {returnLocalDate.parse(curDay).with(TemporalAdjusters.nextOrSame(DayOfWeek.of(dayOfWeek))).toString();

}else{returnLocalDate.parse(curDay).with(TemporalAdjusters.next(DayOfWeek.of(dayOfWeek))).toString();

}

}/*** 获取上一个星期的日期

*

*@paramcurDay 指定日期(yyyy-MM-dd)

*@paramdayOfWeek 数字范围(monday:1~sunday:7)

*@paramisCurDay 是否包含当天,true:是,false:不包含

*@return日期(yyyy-MM-dd)

*@authorzero 2019/04/02*/

public static String getPreWeekDate(String curDay, int dayOfWeek, booleanisCurDay) {

dayOfWeek= dayOfWeek < 1 || dayOfWeek > 7 ? 1: dayOfWeek;if(isCurDay) {returnLocalDate.parse(curDay).with(TemporalAdjusters.previousOrSame(DayOfWeek.of(dayOfWeek))).toString();

}else{returnLocalDate.parse(curDay).with(TemporalAdjusters.previous(DayOfWeek.of(dayOfWeek))).toString();

}

}/*** 获取指定日期当月的最后或第一个星期日期

*

*@paramcurDay 指定日期(yyyy-MM-dd)

*@paramdayOfWeek 周几(1~7)

*@paramlastOrFirst true:最后一个,false本月第一个

*@return日期(yyyy-MM-dd)

*@authorzero 2019/04/02*/

public static String getFirstOrLastWeekDate(String curDay, int dayOfWeek, booleanlastOrFirst) {

dayOfWeek= dayOfWeek < 1 || dayOfWeek > 7 ? 1: dayOfWeek;if(lastOrFirst) {returnLocalDate.parse(curDay).with(TemporalAdjusters.lastInMonth(DayOfWeek.of(dayOfWeek))).toString();

}else{returnLocalDate.parse(curDay).with(TemporalAdjusters.firstInMonth(DayOfWeek.of(dayOfWeek))).toString();

}

}public static voidmain(String[] args) {

System.out.println("===================");//String curDate = "2019-04-10";//指定日期//System.out.println(getLastDayOfMonth(curDate, true));//System.out.println(getLastDayOfMonth(curDate, false));//System.out.println(getLastDayOfYear(curDate, true));//System.out.println(getLastDayOfYear(curDate, false));//System.out.println("===================");//String startDate = "2019-02-28", endDate = "2019-03-05", period = DAY;//System.out.println(getPieDateRange(startDate, endDate, period));//System.out.println("===================");//System.out.println(getNextWeekDate("2019-02-28", 1, false));//System.out.println(getPieDateRange("2019-12-28", "2020-03-01", DAY));//System.out.println("===================");//System.out.println(getFirstOrLastWeekDate("2019-04-02", 0, false));//System.out.println(getPreWeekDate("2019-04-02", 2, false));//System.out.println(getNextWeekDate("2019-04-02", 2, false));//System.out.println("===================");//System.out.println("当前时间戳:" + Instant.now());//System.out.println("当前时间:" + LocalDateTime.now());//System.out.println("===================");//System.out.println(peridCount("2019-01-30", "2019-03-31", MONTH));//System.out.println(isLeapYear("2019-03-31"));//System.out.println(LocalDate.now().isLeapYear());//System.out.println("===================");//System.out.println(getAfterOrPreDate("2019-03-31", WEEK, -1));//System.out.println(getAfterOrPreDayDate(-5));//System.out.println(getAfterOrPreDayDate(-3));//System.out.println(getAfterOrPreDayDate(6));//System.out.println(getAfterOrPreYearDate(6));//System.out.println(getAfterOrPreWeekDate(1));//System.out.println("===================");//clock();//isBirthday(7, 13);//LocalDate date0 = LocalDate.of(2019, Month.OCTOBER, 31);//LocalDate date = LocalDate.of(2019, 3, 31);//System.out.println(date0.equals(LocalDate.now()));//System.out.println(date.getYear() + "-" + date.getMonthValue() + "-" + date.getDayOfMonth());//System.out.println(getNowTime_EN());//System.out.println(getAfterNowTimeSimp(SECOND, 5L));//System.out.println("===================");//System.out.println(getAfterNowTime(SECOND, 5L));//System.out.println(getAfterNowTimePlus(yyyyMMddHHmm_EN, SECOND, 5L));//System.out.println("===================");//System.out.println(getNowDate_EN());//System.out.println(getNowDate_CN());//System.out.println(getTime("HH:mm:ss"));//System.out.println(getNowTime_EN());//System.out.println(getNowTime_CN());//System.out.println(getNowLocalTime_shot());//System.out.println(getNowLocalTime_full());//System.out.println(getNowLocalTime_long());//System.out.println(getNowLocalTime_medium());//System.out.println(getNodeTime("week"));//System.out.println(transformWeekEN2Num(null));//System.out.println("===================");

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值