public class LocalDateUtil
extends java.lang.Object
| 限定符和类型 | 方法和说明 |
|---|---|
static java.time.LocalDate |
now()
获取当前日期,默认当前系统时区
|
static java.time.LocalDate |
now(java.time.ZoneId zoneId)
获取指定时区的当前日期
|
static java.time.LocalDate |
ofString(java.lang.String str,
java.time.format.DateTimeFormatter formatter)
字符串日期转LocalDate
|
static java.time.LocalDate |
ofString(java.lang.String str,
java.lang.String format)
字符串日期转LocalDate
|
static java.lang.String |
toString(java.time.LocalDate localDate)
LocalDate日期转日期格式字符串,默认yyyy-MM-dd格式
|
static java.lang.String |
toString(java.time.LocalDate localDate,
java.time.format.DateTimeFormatter formatter)
LocalDate日期转日期格式字符串,指定日期字符串格式
|
static java.lang.String |
toString(java.time.LocalDate localDate,
java.lang.String format)
LocalDate日期转日期格式字符串,指定日期字符串格式
|
public static java.lang.String toString(java.time.LocalDate localDate)
localDate - 时间public static java.lang.String toString(java.time.LocalDate localDate,
java.time.format.DateTimeFormatter formatter)
localDate - 时间formatter - 格式化日期格式对象,如:DateTimeFormatter.ofPattern("yyyy-MM-dd");public static java.lang.String toString(java.time.LocalDate localDate,
java.lang.String format)
localDate - 时间format - 格式化日期格式字符串,如:yyyy-MM-ddpublic static java.time.LocalDate ofString(java.lang.String str,
java.time.format.DateTimeFormatter formatter)
str - 字符串格式日期formatter - 日期格式化对象,如:DateTimeFormatter.ofPattern("yyyy-MM-dd");public static java.time.LocalDate ofString(java.lang.String str,
java.lang.String format)
str - 字符串格式日期format - 日期格式化字符串,如:yyyy-MM-ddpublic static java.time.LocalDate now()
public static java.time.LocalDate now(java.time.ZoneId zoneId)
zoneId - 时区