|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.ic.doc.automed.util.DateUtil
public class DateUtil
Field Summary | |
---|---|
private static java.util.Calendar |
_cal
|
private static java.text.DateFormat |
_dateFormat
|
private static java.text.DateFormat |
_iqlDateFormat
|
Constructor Summary | |
---|---|
private |
DateUtil()
|
Method Summary | |
---|---|
static java.util.Date |
formatIQLDate(java.lang.String ds)
Convert an IQL date time string into a Date object |
static java.lang.String |
getBriefDateString()
Return a brief date string of current date Example: 20/7/2006 1:1:1---> 20060720 |
static java.lang.String |
getClockRepresentation(java.util.Date dateObj)
Return a standard clock representation of a Date object |
static java.lang.String |
getClockRepresentation(long numMilliSecs)
Return a standard clock representation from the number of millisecs |
static java.lang.String |
getClockRepresentation(long[] timeElements)
Return a standard clock representation of a time value. |
static java.util.Date |
getCurrentDate()
Return the current date/time in a standard format |
static java.lang.String |
getDate()
Return the current date/time in a standard format |
static java.util.Date |
getDate(long millisecs)
Return a date from number of its milli-seconds |
static long |
getDateAsMillisecs()
Return the current date as the number of milli-seconds |
static long |
getDateAsMillisecs(java.lang.String dstr)
|
static java.util.Date |
getDateInstance(java.lang.String dstr)
|
static java.lang.String |
getDateString()
Return a date string of current date Example: 20/7/2006 1:1:1---> 20060720_010101 |
static java.util.Date |
getIQLDateInstance(java.lang.String dstr)
|
static long |
getMilliseconds(java.util.Date dateObj)
Convert a Date object into the number of milliseconds from start of the clock |
static boolean |
isGreaterThanOrEqualTo(java.util.Date date1,
java.util.Date date2)
|
static void |
main(java.lang.String[] args)
|
static long[] |
subtractDate(java.util.Date date1,
java.util.Date date2)
Subtract Date 1 from Date 2 to return the result as
an array of numbers of hours, minutes, and seconds |
static long[] |
subtractDate(java.util.Date date1,
int numDays)
Subtract Date 1 from Date 2 to return the result as
an array of numbers of hours, minutes, and seconds |
static long[] |
subtractDate(long date1AsMillisecs,
long date2AsMillisecs)
Subtract Date 1 from Date 2 to return the result as
an array of numbers of hours, minutes, and seconds |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.Calendar _cal
private static java.text.DateFormat _dateFormat
private static java.text.DateFormat _iqlDateFormat
Constructor Detail |
---|
private DateUtil()
Method Detail |
---|
public static java.util.Date formatIQLDate(java.lang.String ds)
public static long[] subtractDate(java.util.Date date1, java.util.Date date2)
Date
1 from Date
2 to return the result as
an array of numbers of hours, minutes, and seconds
date1
- Date
object to be subtracteddate2
- Date
object to be subtracted from (i.e. date2 - date1)
long
[] a long-type array of hours, minutes and secondspublic static boolean isGreaterThanOrEqualTo(java.util.Date date1, java.util.Date date2)
public static long[] subtractDate(java.util.Date date1, int numDays)
Date
1 from Date
2 to return the result as
an array of numbers of hours, minutes, and seconds
date1
- Date
object to be subtractednumDays
- the number of days to be subtracted from date1
long
[] a long-type array of hours, minutes and secondspublic static long[] subtractDate(long date1AsMillisecs, long date2AsMillisecs)
Date
1 from Date
2 to return the result as
an array of numbers of hours, minutes, and seconds
date1
- first date as the number of millsecondsdate2
- second date as the number of millseconds
long
[] a long-type array of hours, minutes and secondspublic static java.lang.String getDate()
String
- date/time stringpublic static java.util.Date getCurrentDate()
String
- date/time stringpublic static long getDateAsMillisecs()
public static long getDateAsMillisecs(java.lang.String dstr)
public static java.util.Date getDate(long millisecs)
public static java.lang.String getDateString()
public static java.lang.String getBriefDateString()
public static long getMilliseconds(java.util.Date dateObj)
Date
object into the number of milliseconds from start of the clock
public static java.lang.String getClockRepresentation(long numMilliSecs)
public static java.lang.String getClockRepresentation(java.util.Date dateObj)
public static java.lang.String getClockRepresentation(long[] timeElements)
{@link
- long}[] an array of time elements, typically the number of hours, public static void main(java.lang.String[] args)
public static java.util.Date getDateInstance(java.lang.String dstr)
public static java.util.Date getIQLDateInstance(java.lang.String dstr)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |