|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.util.DateUtil
public class DateUtil
Utility class for date manipulation. This class gives a simple interface for common Date, Calendar and Timezone operations. It is possible to apply subsequent transformations to an initial date, and retrieve the changed Date object at any point.
Constructor Summary | |
---|---|
DateUtil()
Inizialize a new instance with the current date |
|
DateUtil(java.util.Date d)
Inizialize a new instance with the given date |
Method Summary | |
---|---|
DateUtil |
addMinutes(int minutes)
Make the date go forward of the specified amount of minutes The internal date is changed after this call. |
int |
getDaysSince(java.util.Date date)
Get the days passed from the specified date up to the date provided in the constructor |
java.util.Date |
getTime()
Get the current time |
java.lang.String |
getTZ()
Get the current TimeZone |
boolean |
isAfter(java.util.Date date)
Utility method wrapping Calendar.after method Compares the date field parameter with the date provided with the constructor answering the question: date from constructor is after the given param date ? |
DateUtil |
removeDays(int days)
Make the date go back of the specified amount of days The internal date is changed after this call. |
void |
setTime(java.util.Date d)
Set a new time |
DateUtil |
toGMT()
Convert the date to GMT. |
DateUtil |
toMidnight()
Convert the time to the midnight of the currently set date. |
DateUtil |
toTZ(java.lang.String tz)
Convert the date to the given timezone. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DateUtil()
public DateUtil(java.util.Date d)
Method Detail |
---|
public void setTime(java.util.Date d)
public java.util.Date getTime()
public java.lang.String getTZ()
public DateUtil toMidnight()
public DateUtil removeDays(int days)
public DateUtil addMinutes(int minutes)
public DateUtil toGMT()
public DateUtil toTZ(java.lang.String tz)
tz
- The name of the timezone to set
public int getDaysSince(java.util.Date date)
date
- The starting date
public boolean isAfter(java.util.Date date)
date
- The date to be used for comparison
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |