|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.semanticdesktop.aperture.util.DateUtil
public class DateUtil
Provides utility methods for handling dates.
Constructor Summary | |
---|---|
DateUtil()
|
Method Summary | |
---|---|
static String |
date2String(Date date)
Format the given date in a good date format: ISO-8601, using the - seperators accordingly. |
static String |
dateTime2String(Date date)
Format the given date in a good dateTime format: ISO-8601, using the T separator and the - and : seperators accordingly. |
static String |
dateTime2UTCString(Date date)
Returns the given date formatted as an ISO 8601 dateTime string normalized to the UTC timezone. |
static boolean |
dateTimeEqualToUTCString(Date dateTime,
String utcString)
Returns true if two dates are equal - denote the same time in milliseconds from the Epoch. |
static boolean |
dateTimeStringEqualToUTCString(String dateTimeString,
String utcString)
Returns true if two dates are equal - denote the same time in milliseconds from the Epoch. |
static DateFormat |
getISO8601DateFormat()
Returns a statically shared DateFormat that uses the ISO-8601 format, which is used by XSD-DATETIME. |
static DateFormat |
getISO8601DateFormatNoTimezone()
Returns a statically shared DateFormat that uses the ISO-8601 format, which is used by XSD-DATETIME. |
static DateFormat |
getPlainDateFormat()
Returns a statically shared DateFormat that uses the ISO-8601 format, which is used by XSD-DATE |
static Date |
string2Date(String string)
Parses the given string as a Date using the same date format as date2String. |
static Date |
string2DateTime(String string)
Parses the given string as a Date using the same date format as dateTime2String. |
static String |
string2UTCString(String string)
Converts the string in the ISO-8601 dateTime format to a string representing the same timestamp, normalized to the UTC timezone. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DateUtil()
Method Detail |
---|
public static String dateTime2String(Date date)
date
- A date instance.
string2DateTime(String)
public static String date2String(Date date)
date
- A date instance.
string2Date(String)
public static Date string2DateTime(String string) throws ParseException
string
- A String in ISO-8601 format.
ParseException
- when the specified string did not conform to the ISO-8601 standard.dateTime2String(Date)
public static Date string2Date(String string) throws ParseException
string
- A String in ISO-8601 date format.
ParseException
- when the specified string did not conform to the ISO-8601 standard.date2String(Date)
public static String string2UTCString(String string) throws ParseException
string
-
ParseException
public static String dateTime2UTCString(Date date)
date
-
public static boolean dateTimeStringEqualToUTCString(String dateTimeString, String utcString) throws ParseException
dateTimeString
- a string in valid full (date + time) ISO8601 format, in any timezoneutcString
- a string in valid full (date + time) ISO8601 format in the UTC timezone
ParseException
- if the dateString format is wrongpublic static boolean dateTimeEqualToUTCString(Date dateTime, String utcString)
dateTime
- an instance of Date
utcString
- a string in valid full (date + time) ISO8601 format in the UTC timezone
ParseException
- if the dateString format is wrongpublic static DateFormat getISO8601DateFormat()
public static DateFormat getISO8601DateFormatNoTimezone()
public static DateFormat getPlainDateFormat()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |