mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-27 21:10:54 +00:00
date helper
This commit is contained in:
parent
383356deb0
commit
3ed20338ed
16
src/main/java/emu/grasscutter/utils/DateHelper.java
Normal file
16
src/main/java/emu/grasscutter/utils/DateHelper.java
Normal file
@ -0,0 +1,16 @@
|
||||
package emu.grasscutter.utils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Calendar;
|
||||
|
||||
public final class DateHelper {
|
||||
public static Date onlyYDM(Date now) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(now);
|
||||
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();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user