|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.berkeley.guir.lib.util.DateLib
Formats Java Date object as ISO date (ISO8601). Format is YYYYMMDDTHHMMSS. For example,
19960329T083000Z 19960401T235959This needs to be fixed so that illegal dates will not be allowed, and that leap years will be calculated correctly. This is because the Calendar class does not check bounds correctly (e.g. February 29 becomes March 1). Go figure.
This software is distributed under the Berkeley Software License.
Revisions: - GUIRLib-v1.0-1.0.0, Nov 27 1997, JH Created class - GUIRLib-v1.2-1.0.0, Jun 22 2000, JH Touched for GUIRLib release - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH Touched for GUIRLib release - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH Touched for GUIRLib release
Method Summary | |
static int |
compareDate(Date date1,
Date date2)
Compare two dates. |
static int |
compareDate(Date date1,
String strDate2)
See the other compareDate() method for details. |
static int |
compareDate(String strDate1,
Date date2)
See the other compareDate() method for details. |
static int |
compareDate(String strDate1,
String strDate2)
See the other compareDate() method for details. |
static String |
DateToISO(Date date)
Convert a Java Date object to an ISO date string. |
static String |
getCurrentISODate()
Get the current date and time in ISO format. |
static Date |
ISOToDate(String str)
Convert an ISO date string to a Java Date object. |
static boolean |
isValidISODate(String str)
See if the specified String is a valid date. |
static void |
main(String[] argv)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static String getCurrentISODate()
public static int compareDate(Date date1, Date date2)
if date1 lthan date2 = -1 if date1 = date2 = 0 if date1 gthan date2 = 1
date1
- is a Java Date object.date2
- is a Java Date object.public static int compareDate(Date date1, String strDate2)
date1
- is a Java Date object.strDate2
- is an ISO format date.public static int compareDate(String strDate1, Date date2)
strDate1
- is an ISO format date.date2
- is a Java Date object.public static int compareDate(String strDate1, String strDate2)
strDate1
- is an ISO format date.strDate2
- is an ISO format date.public static String DateToISO(Date date)
public static boolean isValidISODate(String str)
public static Date ISOToDate(String str)
public static void main(String[] argv)
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |