mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
issue#896添加
This commit is contained in:
parent
145ea0820d
commit
e2dcff3bfd
@ -287,6 +287,19 @@ public class DateUtil {
|
||||
return DateTime.of(date).dayOfMonth();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得指定日期是这个日期所在月份的第几天<br>
|
||||
*
|
||||
* @param date 日期
|
||||
* @return 天
|
||||
* issue#896@Github
|
||||
*/
|
||||
public static int dayOfYear(Date date) {
|
||||
Calendar instance = Calendar.getInstance();
|
||||
instance.setTime(date);
|
||||
return instance.get(Calendar.DAY_OF_YEAR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得指定日期是星期几,1表示周日,2表示周一
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user