fix test 2

This commit is contained in:
Milos Kozak 2019-03-30 10:04:22 +01:00
parent 474850c727
commit bc23ca30e2

View file

@ -72,11 +72,14 @@ public class DateUtil {
}
public static Date toDate(Integer seconds) {
Calendar calendar = new GregorianCalendar();
calendar.set(Calendar.MONTH, 0); // Set january to be sure we miss DST changing
Calendar calendar = GregorianCalendar.getInstance(TimeZone.getTimeZone("UTC"));
calendar.set(Calendar.YEAR, 2000);
calendar.set(Calendar.MONTH, Calendar.JANUARY);
calendar.set(Calendar.DAY_OF_WEEK_IN_MONTH, 1);
calendar.set(Calendar.HOUR_OF_DAY, seconds / 60 / 60);
calendar.set(Calendar.MINUTE, (seconds / 60) % 60);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
}