|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mpxj.utility.DateUtility
public final class DateUtility
Utility methods for manipulating dates.
| Field Summary | |
|---|---|
static Date |
FIRST_DATE
First date supported by Microsoft Project: January 01 00:00:00 1984. |
static Date |
LAST_DATE
Last date supported by Microsoft Project: Friday December 31 23:59:00 2049. |
| Method Summary | |
|---|---|
static int |
compare(Date d1,
Date d2)
Compare two dates, handling null values. |
static int |
compare(Date startDate,
Date endDate,
Date targetDate)
This method compares a target date with a date range. |
static int |
compare(Date startDate,
Date endDate,
long targetDate)
This method compares a target date with a date range. |
static Date |
getCanonicalTime(Date date)
This method resets the date part of a date time value to a standard date (1/1/1). |
static Date |
getDateFromLong(long date)
Creates a date from the equivalent long value. |
static Date |
getDayEndDate(Date date)
Returns a new Date instance whose value represents the end of the day (i.e. |
static Date |
getDayStartDate(Date date)
Returns a new Date instance whose value represents the start of the day (i.e. |
static Date |
getTime(int hour,
int minutes)
Create a Date instance representing a specific time. |
static Date |
getTimestampFromLong(long timestamp)
Creates a timestamp from the equivalent long value. |
static Duration |
getVariance(Task task,
Date date1,
Date date2,
TimeUnit format)
This utility method calculates the difference in working time between two dates, given the context of a task. |
static void |
setTime(Calendar cal,
Date time)
Given a date represented by a Calendar instance, set the time component of the date based on the hours and minutes of the time supplied by the Date instance. |
static Date |
setTime(Date date,
Date canonicalTime)
Given a date represented by a Date instance, set the time component of the date based on the hours and minutes of the time supplied by the Date instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Date FIRST_DATE
public static final Date LAST_DATE
| Method Detail |
|---|
public static Date getDayStartDate(Date date)
date - date to convert
public static Date getDayEndDate(Date date)
date - date to convert
public static Date getCanonicalTime(Date date)
date - date time value
public static int compare(Date startDate,
Date endDate,
Date targetDate)
startDate - range start dateendDate - range end datetargetDate - target date
public static int compare(Date startDate,
Date endDate,
long targetDate)
startDate - range start dateendDate - range end datetargetDate - target date in milliseconds
public static int compare(Date d1,
Date d2)
d1 - Date instanced2 - Date instance
public static Duration getVariance(Task task,
Date date1,
Date date2,
TimeUnit format)
task - parent taskdate1 - first datedate2 - second dateformat - required format for the resulting duration
public static Date getDateFromLong(long date)
date - date expressed as a long integer
public static Date getTimestampFromLong(long timestamp)
timestamp - timestamp expressed as a long integer
public static Date getTime(int hour,
int minutes)
hour - hour 0-23minutes - minutes 0-59
public static void setTime(Calendar cal,
Date time)
cal - Calendar instance representing the datetime - Date instance representing the time of day
public static Date setTime(Date date,
Date canonicalTime)
date - Date instance representing the datecanonicalTime - Date instance representing the time of day
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||