|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.org.iscream.cms.util.DateUtils
Provides easy to use date functions.
Field Summary | |
private String |
_name
This is the friendly identifier of the component this class is running in. |
private static String |
daysKey
|
private static String |
hoursKey
|
private static String |
minsKey
|
String |
REVISION
The current CVS revision of this class |
private static String |
secsKey
|
static long |
secsPerDay
|
static long |
secsPerHour
|
static long |
secsPerMin
|
static long |
secsPerMonth
|
static long |
secsPerWeek
|
Constructor Summary | |
DateUtils()
|
Method Summary | |
static String |
dateString(long t)
Return a nice String representation of the date. |
static String |
dayName(long t)
Return a String representation of the day name (short format). |
static String |
formatTime(long time)
Format a long time (in seconds) as a String. |
static String |
formatTime(long time,
String layout)
Format a long time (in seconds) as a String. |
static String |
getTimeString(long time)
Takes a time period in seconds and converts it to a reasonable message. |
static String |
hourString(long t)
Return a String representation of the hour. |
static long |
now()
Return the number of seconds between the epoch and now. |
static String |
shortDateString(long t)
Return a nice short String representation of the date. |
static long |
startOfToday()
Return the number of seconds between the epoch and midnight earlier today. |
static long |
subtractDays(long before,
int days)
Accept a long representing the number of seconds since the epoch. |
static long |
subtractHours(long before,
int hours)
Accept a long representing the number of seconds since the epoch. |
static long |
subtractMonths(long before,
int months)
Accept a long representing the number of seconds since the epoch. |
static long |
subtractWeeks(long before,
int weeks)
Accept a long representing the number of seconds since the epoch. |
static String |
timeString(long t)
Return a String representation of the time (short format). |
String |
toString()
Overrides the Object.toString()
method to provide clean logging (every class should have this). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public final String REVISION
public static final long secsPerMonth
public static final long secsPerWeek
public static final long secsPerDay
public static final long secsPerHour
public static final long secsPerMin
private static final String daysKey
private static final String hoursKey
private static final String minsKey
private static final String secsKey
private String _name
Constructor Detail |
public DateUtils()
Method Detail |
public static long startOfToday()
public static long now()
public static long subtractMonths(long before, int months)
public static long subtractWeeks(long before, int weeks)
public static long subtractDays(long before, int days)
public static long subtractHours(long before, int hours)
public static String dateString(long t)
public static String shortDateString(long t)
public static String hourString(long t)
public static String dayName(long t)
public static String timeString(long t)
public static String formatTime(long time)
time
- A long value representing the time period in seconds
public static String formatTime(long time, String layout)
time
- A long value representing the time period in secondslayout
- The custom layout format to use.
public static String getTimeString(long time)
time
- the time period in seconds
public String toString()
Object.toString()
method to provide clean logging (every class should have this).
This uses the uk.org.iscream.cms.server.util.FormatName class
to format the toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |