diff --git a/src/main/java/org/apache/commons/lang3/time/DateUtils.java b/src/main/java/org/apache/commons/lang3/time/DateUtils.java index c242bd587..e9ae23f00 100644 --- a/src/main/java/org/apache/commons/lang3/time/DateUtils.java +++ b/src/main/java/org/apache/commons/lang3/time/DateUtils.java @@ -666,6 +666,19 @@ public class DateUtils { return c; } + //----------------------------------------------------------------------- + /** + * Converts a {@code Date} of a given {@code TimeZone} into a {@code Calendar} + * @param date the date to convert to a Calendar + * @param timeZone the time zone of the @{code date} + * @return + */ + public static Calendar toCalendar(final Date date, final TimeZone tz) { + final Calendar c = Calendar.getInstance(tz); + c.setTime(date); + return c; + } + //----------------------------------------------------------------------- /** *

Rounds a date, leaving the field specified as the most