
be.bagofwords.util.DateUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bow-utils Show documentation
Show all versions of bow-utils Show documentation
Utility classes that are used in the count-db project and other bow-* projects
The newest version!
package be.bagofwords.util;
import java.util.Calendar;
import java.util.Date;
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
public static Date createDate(int year, int month, int day) {
Date date = new Date();
date = DateUtils.truncate(date, Calendar.HOUR);
date = DateUtils.setYears(date, year);
date = DateUtils.setMonths(date, month - 1);
date = DateUtils.setDays(date, day);
return date;
}
public static Date createDate(int year, int month, int day, int hours, int minutes, int seconds) {
Date date = createDate(year, month, day);
date = DateUtils.setHours(date, hours);
date = DateUtils.setMinutes(date, minutes);
date = DateUtils.setSeconds(date, seconds);
return date;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy