fix test 2
This commit is contained in:
parent
474850c727
commit
bc23ca30e2
1 changed files with 5 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue