public class Calculator extends Object
| 构造器和说明 |
|---|
Calculator() |
| 限定符和类型 | 方法和说明 |
|---|---|
static DateTime |
endTime(Date date) |
static DateTime |
endTime(LocalDate date) |
static DateTime |
endTime(LocalDateTime dateTime) |
static LocalTime |
endTimeOfDay()
结束时间 例如:23:59:59
|
static DateTime |
endTimeOfThisWeek() |
static DateTime |
endTimeOfToday() |
static int |
getAge(Date birthDay)
计算年龄(周岁)
|
static int |
getAge(LocalDate birthDay)
计算年龄(周岁)
|
static int |
getAge(LocalDateTime birthDay)
计算年龄(周岁)
|
static LocalDateTime |
getNow() |
static Date |
getNowDate() |
static LocalDate |
getNowLocalDate() |
static LocalTime |
getNowLocalTime() |
static Date |
minus(Date date,
long stepSize,
TemporalUnit unit)
减指定单位(年月日时分秒毫秒)指定步长
|
static Period |
periodBetween(LocalDate startDateInclusive,
LocalDate endDateExclusive) |
static Date |
plus(Date date,
long stepSize,
TemporalUnit unit)
加指定单位(年月日时分秒毫秒)指定步长
|
public static LocalDateTime getNow()
public static Date getNowDate()
public static LocalDate getNowLocalDate()
public static LocalTime getNowLocalTime()
public static Date plus(Date date, long stepSize, TemporalUnit unit)
date - 日期stepSize - 步长public static Date minus(Date date, long stepSize, TemporalUnit unit)
date - 日期stepSize - 步长public static DateTime endTime(LocalDateTime dateTime)
public static DateTime endTimeOfToday()
public static DateTime endTimeOfThisWeek()
public static LocalTime endTimeOfDay()
public static int getAge(LocalDate birthDay)
birthDay - 出生日期public static int getAge(LocalDateTime birthDay)
birthDay - 出生日期public static int getAge(Date birthDay)
birthDay - 出生日期Copyright © 2021. All rights reserved.