Package | Description |
---|---|
cn.hutool.core.date |
日期封装,日期的核心为DateTime类,DateUtil提供日期操作的入口
|
Modifier and Type | Method and Description |
---|---|
static Week |
LocalDateTimeUtil.dayOfWeek(LocalDate localDate)
获取
LocalDate 对应的星期值 |
Week |
DateTime.dayOfWeekEnum()
获得指定日期是星期几
|
static Week |
DateUtil.dayOfWeekEnum(Date date)
获得指定日期是星期几
|
Week |
DateTime.getFirstDayOfWeek()
获得一周的第一天,默认为周一
|
static Week |
Week.of(DayOfWeek dayOfWeek)
将
DayOfWeek 星期相关值转换为Week枚举对象 |
static Week |
Week.of(int calendarWeekIntValue)
将
Calendar 星期相关值转换为Week枚举对象 |
static Week |
Week.of(String name)
解析别名为Week对象,别名如:sun或者SUNDAY,不区分大小写
|
static Week |
DateUtil.thisDayOfWeekEnum() |
static Week |
Week.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Week[] |
Week.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
Modifier and Type | Method and Description |
---|---|
DateTime |
DateTime.setFirstDayOfWeek(Week firstDayOfWeek)
设置一周的第一天
JDK的Calendar中默认一周的第一天是周日,Hutool中将此默认值设置为周一 设置一周的第一天主要影响 DateTime.weekOfMonth() 和DateTime.weekOfYear() 两个方法 |
Copyright © 2024. All rights reserved.