Skip to content

Commit

Permalink
Fixed timezone related bug in time module.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlink committed Feb 10, 2023
1 parent ddb5e20 commit 322ef7f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ protected Arbitrary<Calendar> arbitrary() {
@SuppressWarnings("MagicConstant")
public static Calendar localDateToCalendar(LocalDate date) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
calendar.set(date.getYear(), monthToCalendarMonth(date.getMonth()), date.getDayOfMonth(), 0, 0, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ protected Arbitrary<Date> arbitrary() {

public static Calendar dateToCalendar(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
calendar.setTime(date);
return calendar;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ public class ForCalendar {

public static Calendar getCalendar(int year, int month, int day) {
Calendar calendar = Calendar.getInstance();
calendar.setTimeZone(TimeZone.getTimeZone("GMT"));
calendar.set(year, month, day, 0, 0, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar;
Expand Down

0 comments on commit 322ef7f

Please sign in to comment.