|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject | +--xbn.util.UtilDate
Random functions for analyzing and manipulating java.util.Dates. See java.util.Date.
Source code: UtilDate.java.
Fields inherited from class xbn.XBNObject |
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP |
Constructor Summary | |
UtilDate()
Create a UtilDate. |
Method Summary | |
Date |
getDateXAgo(long l_multiplier,
int i_unitsAgo,
Date d_from)
Get a Date that is X units before the provided date. |
Date |
getDateXAgoDays(int i_unitsAgo,
Date d_from)
Get a Date that is X days before the provided date. |
Date |
getDateXAgoHours(int i_unitsAgo,
Date d_from)
Get a Date that is X hours before the provided date. |
Date |
getDateXAgoMinutes(int i_unitsAgo,
Date d_from)
Get a Date that is X minutes before the provided date. |
Date |
getDateXAgoSeconds(int i_unitsAgo,
Date d_from)
Get a Date that is X seconds before the provided date. |
Date |
getDateXAgoWeeks(int i_unitsAgo,
Date d_from)
Get a Date that is X weeks before the provided date. |
Date |
getDateXBeforeNow(long l_multiplier,
int i_unitsAgo)
Get a Date that is X units before now. |
Date |
getDateXBNDays(int i_unitsAgo)
Get a Date that is X days before now. |
Date |
getDateXBNHours(int i_unitsAgo)
Get a Date that is X hours before now. |
Date |
getDateXBNMinutes(int i_unitsAgo)
Get a Date that is X minutes before now. |
Date |
getDateXBNSeconds(int i_unitsAgo)
Get a Date that is X seconds before now. |
Date |
getDateXBNWeeks(int i_unitsAgo)
Get a Date that is X weeks before now. |
static long |
getMillsInADay()
How many milleseconds are there in a day? |
static long |
getMillsInAMinute()
How many milleseconds are there in a minute? |
static long |
getMillsInAnHour()
How many milleseconds are there in an hour? |
static long |
getMillsInASecond()
How many milleseconds are there in a second? |
static long |
getMillsInAWeek()
How many milleseconds are there in a week? |
int |
getNowMinusYDays(Date d_y)
How many days before now is the provided date? |
int |
getNowMinusYHours(Date d_y)
How many hours before now is the provided date? |
int |
getNowMinusYMinutes(Date d_y)
How many minutes before now is the provided date? |
int |
getNowMinusYSeconds(Date d_y)
How many seconds before now is the provided date? |
int |
getNowMinusYUnits(Date d_y,
long l_multiplier)
How many units before now is the provided date? |
int |
getNowMinusYWeeks(Date d_y)
How many weeks before now is the provided date? |
int |
getXMinusYDays(Date d_x,
Date d_y)
How many days separate the provided dates? |
int |
getXMinusYHours(Date d_x,
Date d_y)
How many hours separate the provided dates? |
int |
getXMinusYMinutes(Date d_x,
Date d_y)
How many minutes separate the provided dates? |
int |
getXMinusYSeconds(Date d_x,
Date d_y)
How many seconds separate the provided dates? |
int |
getXMinusYUnits(Date d_x,
Date d_y,
long l_multiplier)
How many units separate the provided dates? |
long |
getXMinusYUnitsLong(Date d_x,
Date d_y,
long l_multiplier)
How many units, represented by a long, separate the provided dates? |
int |
getXMinusYWeeks(Date d_x,
Date d_y)
How many weeks separate the provided dates? |
Methods inherited from class xbn.XBNObject |
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UtilDate()
Create a UtilDate. This constructor does nothing.
Method Detail |
public final Date getDateXBNSeconds(int i_unitsAgo)
Get a Date that is X seconds before now.
getDateXBeforeNow(getMillsInASecond(), i_unitsAgo)
public final Date getDateXBNMinutes(int i_unitsAgo)
Get a Date that is X minutes before now.
getDateXBeforeNow(getMillsInAMinute(), i_unitsAgo)
public final Date getDateXBNHours(int i_unitsAgo)
Get a Date that is X hours before now.
getDateXBeforeNow(getMillsInAMinute(), i_unitsAgo)
public final Date getDateXBNDays(int i_unitsAgo)
Get a Date that is X days before now.
getDateXBeforeNow(getMillsInADay(), i_unitsAgo)
public final Date getDateXBNWeeks(int i_unitsAgo)
Get a Date that is X weeks before now.
getDateXBeforeNow(getMillsInAWeek(), i_unitsAgo)
public final Date getDateXBeforeNow(long l_multiplier, int i_unitsAgo)
Get a Date that is X units before now.
getDateXAgo(l_multiplier, i_unitsAgo, (new Date()))
public final Date getDateXAgoSeconds(int i_unitsAgo, Date d_from)
Get a Date that is X seconds before the provided date.
getDateXAgo(getMillsInASecond(), i_unitsAgo, d_from)
public final Date getDateXAgoMinutes(int i_unitsAgo, Date d_from)
Get a Date that is X minutes before the provided date.
getDateXAgo(getMillsInAMinute(), i_unitsAgo, d_from)
public final Date getDateXAgoHours(int i_unitsAgo, Date d_from)
Get a Date that is X hours before the provided date.
getDateXAgo(getMillsInAMinute(), i_unitsAgo, d_from)
public final Date getDateXAgoDays(int i_unitsAgo, Date d_from)
Get a Date that is X days before the provided date.
getDateXAgo(getMillsInADay(), i_unitsAgo, d_from)
public final Date getDateXAgoWeeks(int i_unitsAgo, Date d_from)
Get a Date that is X weeks before the provided date.
getDateXAgo(getMillsInAWeek(), i_unitsAgo, d_from)
public final Date getDateXAgo(long l_multiplier, int i_unitsAgo, Date d_from)
Get a Date that is X units before the provided date.
l_multiplier
- The number used to translate a Date's milleseconds to some other unit. May not be zero.i_unitsAgo
- The number of "units ago" you want the returned date to be, in relation to d_from.d_from
- The date that you want to count back from. May not be null.new Date(d_from.getTime() - (i_unitsAgo / l_multiplier))
public final int getNowMinusYSeconds(Date d_y)
How many seconds before now is the provided date?
getNowMinusYUnits(d_y, getMillsInASecond())
public final int getNowMinusYMinutes(Date d_y)
How many minutes before now is the provided date?
getNowMinusYUnits(d_y, getMillsInAMinute())
public final int getNowMinusYHours(Date d_y)
How many hours before now is the provided date?
getNowMinusYUnits(d_y, getMillsInAnHour())
public final int getNowMinusYDays(Date d_y)
How many days before now is the provided date?
getNowMinusYUnits(d_y, getMillsInADay())
public final int getNowMinusYWeeks(Date d_y)
How many weeks before now is the provided date?
getNowMinusYUnits(d_y, getMillsInAWeek())
public final int getNowMinusYUnits(Date d_y, long l_multiplier)
How many units before now is the provided date?
getXMinusYUnits((new Date()), d_y, l_multiplier)
public final int getXMinusYSeconds(Date d_x, Date d_y)
How many seconds separate the provided dates?
getXMinusYUnits(d_x, d_y, getMillsInASecond())
public final int getXMinusYMinutes(Date d_x, Date d_y)
How many minutes separate the provided dates?
getXMinusYUnits(d_x, d_y, getMillsInAMinute())
public final int getXMinusYHours(Date d_x, Date d_y)
How many hours separate the provided dates?
getXMinusYUnits(d_x, d_y, getMillsInAnHour())
public final int getXMinusYDays(Date d_x, Date d_y)
How many days separate the provided dates?
getXMinusYUnits(d_x, d_y, getMillsInADay())
public final int getXMinusYWeeks(Date d_x, Date d_y)
How many weeks separate the provided dates?
getXMinusYUnits(d_x, d_y, getMillsInAWeek())
public final int getXMinusYUnits(Date d_x, Date d_y, long l_multiplier)
How many units separate the provided dates?
(new Long(d_x, d_y, l_multiplier)).intValue()
public final long getXMinusYUnitsLong(Date d_x, Date d_y, long l_multiplier)
How many units, represented by a long, separate the provided dates?
d_x
- The date on the left side of the minus equation. May not be null.d_y
- The date on the right side of the minus equation. May not be null.l_multiplier
- The number used to translate a Date's milleseconds to some other unit. May not be zero.(d_x.getTime() - d_y.getTime()) / l_multiplier)
public static final long getMillsInASecond()
How many milleseconds are there in a second?
public static final long getMillsInAMinute()
How many milleseconds are there in a minute?
public static final long getMillsInAnHour()
How many milleseconds are there in an hour?
public static final long getMillsInADay()
How many milleseconds are there in a day?
public static final long getMillsInAWeek()
How many milleseconds are there in a week?
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
http://sourceforge.net/projects/xbnjava