| | |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND,0); |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | |
| | | calendar.set(Calendar.HOUR_OF_DAY, 23); |
| | | calendar.set(Calendar.MINUTE, 59); |
| | | calendar.set(Calendar.SECOND, 59); |
| | | calendar.set(Calendar.MILLISECOND,999); |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND,0); |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | | /** |
| | | * 获取当前年的结束时间 |
| | | * @param time 时间 |
| | | * @return 返回时间 格式yyyy-MM-dd 00:00:00 |
| | | * @return 返回时间 格式yyyy-MM-dd 23:59:59 |
| | | */ |
| | | public static Date getYearEnd(Date time) { |
| | | Calendar calendar = Calendar.getInstance(); |
| | |
| | | calendar.set(Calendar.HOUR_OF_DAY, 23); |
| | | calendar.set(Calendar.MINUTE, 59); |
| | | calendar.set(Calendar.SECOND, 59); |
| | | calendar.set(Calendar.MILLISECOND,999); |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | return calendar.getTime(); |
| | | } |
| | | |
| | |
| | | calendar.set(Calendar.HOUR_OF_DAY, 23); |
| | | calendar.set(Calendar.MINUTE, 59); |
| | | calendar.set(Calendar.SECOND, 59); |
| | | calendar.set(Calendar.MILLISECOND, 999); |
| | | return calendar.getTime(); |
| | | } |
| | | |