Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.4
-
None
Description
DateUtils.toCalendar creates a Calendar using .getInstance(). This results in a Calendar in the machine's timezone. The Date object passed in may not be in that same timezone. Since the getTimezoneOffset method of Date is deprecated a new version of toCalendar that accepts a TimeZone would be appropriate:
public static Calendar toCalendar(final Date date, final TimeZone tz) { final Calendar c = Calendar.getInstance(tz); c.setTime(date); return c; }
Attachments
Issue Links
- links to