java.lang.Object
net.fortuna.ical4j.util.Dates
Deprecated.
Utility class for old date/time API no longer required
$Id$
Created on 26/06/2005
Implements a collection of utility methods relevant to date processing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.Number of days in one week.static final intDeprecated.Maximum number of days per month.static final intDeprecated.Maximum number of days per year.static final intDeprecated.Maximum number of weeks per year.static final longDeprecated.Number of milliseconds in one day.static final longDeprecated.Number of milliseconds in one hour.static final longDeprecated.Number of milliseconds in one minute.static final longDeprecated.Number of milliseconds in one second.static final longDeprecated.Number of milliseconds in one week.static final intDeprecated.Constant indicating precision to the day.static final intDeprecated.Constant indicating precision to the second. -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetAbsMonthDay(Date date, int monthDay) Deprecated.Returns the absolute month day for the month specified by the supplied date.static intgetAbsWeekNo(Date date, int weekNo) Deprecated.Returns the absolute week number for the year specified by the supplied date.static intgetAbsYearDay(Date date, int yearDay) Deprecated.Returns the absolute year day for the year specified by the supplied date.static CalendargetCalendarInstance(Date date) Deprecated.Returns an instance ofjava.util.Calendarthat is suitably initialised for working with the specified date.static longDeprecated.Returns theSystem.currentTimeMillis(), rounded to the second.static DategetInstance(Date date, Value type) Deprecated.Returns a new date instance of the specified type.static longround(long time, int precision) Deprecated.It is not all that useful to perform rounding without specifying an explicit timezone.static longDeprecated.Rounds a time value to remove any precision smaller than specified.
-
Field Details
-
MILLIS_PER_SECOND
public static final long MILLIS_PER_SECONDDeprecated.Number of milliseconds in one second.- See Also:
-
MILLIS_PER_MINUTE
public static final long MILLIS_PER_MINUTEDeprecated.Number of milliseconds in one minute.- See Also:
-
MILLIS_PER_HOUR
public static final long MILLIS_PER_HOURDeprecated.Number of milliseconds in one hour.- See Also:
-
MILLIS_PER_DAY
public static final long MILLIS_PER_DAYDeprecated.Number of milliseconds in one day.- See Also:
-
MILLIS_PER_WEEK
public static final long MILLIS_PER_WEEKDeprecated.Number of milliseconds in one week.- See Also:
-
DAYS_PER_WEEK
public static final int DAYS_PER_WEEKDeprecated.Number of days in one week.- See Also:
-
PRECISION_SECOND
public static final int PRECISION_SECONDDeprecated.Constant indicating precision to the second.- See Also:
-
PRECISION_DAY
public static final int PRECISION_DAYDeprecated.Constant indicating precision to the day.- See Also:
-
MAX_WEEKS_PER_YEAR
public static final int MAX_WEEKS_PER_YEARDeprecated.Maximum number of weeks per year.- See Also:
-
MAX_DAYS_PER_YEAR
public static final int MAX_DAYS_PER_YEARDeprecated.Maximum number of days per year.- See Also:
-
MAX_DAYS_PER_MONTH
public static final int MAX_DAYS_PER_MONTHDeprecated.Maximum number of days per month.- See Also:
-
-
Method Details
-
getAbsWeekNo
Deprecated.Returns the absolute week number for the year specified by the supplied date. Note that a value of zero (0) is invalid for the weekNo parameter and anIllegalArgumentExceptionwill be thrown.- Parameters:
date- a date instance representing a week of the yearweekNo- a week number offset- Returns:
- the absolute week of the year for the specified offset
-
getAbsYearDay
Deprecated.Returns the absolute year day for the year specified by the supplied date. Note that a value of zero (0) is invalid for the yearDay parameter and anIllegalArgumentExceptionwill be thrown.- Parameters:
date- a date instance representing a day of the yearyearDay- a day of year offset- Returns:
- the absolute day of month for the specified offset
-
getAbsMonthDay
Deprecated.Returns the absolute month day for the month specified by the supplied date. Note that a value of zero (0) is invalid for the monthDay parameter and anIllegalArgumentExceptionwill be thrown.- Parameters:
date- a date instance representing a day of the monthmonthDay- a day of month offset- Returns:
- the absolute day of month for the specified offset
-
getInstance
Deprecated.Returns a new date instance of the specified type. If no type is specified a DateTime instance is returned.- Parameters:
date- a seed Java date instancetype- the type of date instance- Returns:
- an instance of
net.fortuna.ical4j.model.Date
-
getCalendarInstance
Deprecated.Returns an instance ofjava.util.Calendarthat is suitably initialised for working with the specified date.- Parameters:
date- a date instance- Returns:
- a
java.util.Calendar
-
round
Deprecated.It is not all that useful to perform rounding without specifying an explicit timezone.- Parameters:
time- the time value to roundprecision- the rounding precision- Returns:
- a round time value
-
round
Deprecated.Rounds a time value to remove any precision smaller than specified.- Parameters:
time- the time value to roundprecision- the rounding precisiontz- the timezone of the rounded value- Returns:
- a round time value
-
getCurrentTimeRounded
public static long getCurrentTimeRounded()Deprecated.Returns theSystem.currentTimeMillis(), rounded to the second.By doing a rough rounding here, we avoid an expensive java.util.Calendar based rounding later on.
- Returns:
- the current time in millisec.
-