DateHelper.java 442 Bytes
Newer Older
Yazawazi's avatar
Yazawazi committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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();
    }
}