public final class Dates
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DAYS_PER_WEEK |
static long |
MILLIS_PER_DAY |
static long |
MILLIS_PER_HOUR |
static long |
MILLIS_PER_MINUTE |
static long |
MILLIS_PER_SECOND |
static long |
MILLIS_PER_WEEK |
static int |
PRECISION_DAY |
static int |
PRECISION_SECOND |
| Modifier and Type | Method and Description |
|---|---|
static int |
getAbsMonthDay(java.util.Date date,
int monthDay)
Returns the absolute month day for the month specified by the
supplied date.
|
static int |
getAbsWeekNo(java.util.Date date,
int weekNo)
Returns the absolute week number for the year specified by the
supplied date.
|
static int |
getAbsYearDay(java.util.Date date,
int yearDay)
Returns the absolute year day for the year specified by the
supplied date.
|
static java.util.Calendar |
getCalendarInstance(Date date)
Returns an instance of
java.util.Calendar that is suitably
initialised for working with the specified date. |
static Date |
getInstance(java.util.Date date,
Value type)
Returns a new date instance of the specified type.
|
static long |
round(long time,
int precision) |
static long |
round(long time,
int precision,
java.util.TimeZone tz)
Rounds a time value to remove any precision smaller than specified.
|
public static final long MILLIS_PER_SECOND
public static final long MILLIS_PER_MINUTE
public static final long MILLIS_PER_HOUR
public static final long MILLIS_PER_DAY
public static final long MILLIS_PER_WEEK
public static final int DAYS_PER_WEEK
public static final int PRECISION_SECOND
public static final int PRECISION_DAY
public static int getAbsWeekNo(java.util.Date date,
int weekNo)
IllegalArgumentException
will be thrown.date - weekNo - public static int getAbsYearDay(java.util.Date date,
int yearDay)
IllegalArgumentException
will be thrown.date - yearDay - public static int getAbsMonthDay(java.util.Date date,
int monthDay)
IllegalArgumentException
will be thrown.date - monthDay - public static Date getInstance(java.util.Date date, Value type)
date - a seed Java date instancetype - the type of date instancenet.fortuna.ical4j.model.Datepublic static java.util.Calendar getCalendarInstance(Date date)
java.util.Calendar that is suitably
initialised for working with the specified date.date - a date instancejava.util.Calendarpublic static long round(long time,
int precision)
time - precision - public static long round(long time,
int precision,
java.util.TimeZone tz)
time - the time value to round