|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Clock
Provides some date-related constants and general utility methods relating to dates and times, such as a date/time stamp as a String. Since it's rather expensive to generate a timestamp statically, if a lot of timestamps are needed, generating them from a Clock object is recommended.
| Field Summary | |
|---|---|
static int |
FIELD_CENTURY
A constant indicating the centuries field or units. |
static int |
FIELD_DAY
A constant indicating the days (ie., day-of-month) field or units. |
static int |
FIELD_DECADE
A constant indicating the decades field or units. |
static int |
FIELD_HOUR
A constant indicating the hours field or units. |
static int |
FIELD_MINUTE
A constant indicating the minutes field or units. |
static int |
FIELD_MONTH
A constant indicating the months field or units. |
static int |
FIELD_SECOND
A constant indicating the seconds field or units. |
static int |
FIELD_WEEK
A constant indicating the weeks field or units. |
static int |
FIELD_YEAR
A constant indicating the years field or units. |
| Method Summary | |
|---|---|
String |
getCurrentDate(int UTCOffset)
Returns a String representing the current date and time, provided an integer offset from UTC (eg., '-8' for Pacific Standard Time), using a default format. |
String |
getCurrentDate(int UTCOffset,
String dateformat)
Returns a String representing the current date and time. |
String |
getCurrentDate(int UTCOffset,
String dateformat,
Date date)
Returns a String representing the provided Date. |
String |
getDateStamp(Date date)
Returns a String representing either the date parameter or if null, the current date as a timestamp of the form "yyyyMMdd" (for use in filenames). |
String |
getDCDateStamp()
Returns a String representing the current date as a timestamp of the Dublin Core-compatible form "yyyy-MM-dd". |
String |
getFriendlyTimeStamp(Date date)
Returns a String representing the provided date and time as a timestamp of the form "yyyy-MM-dd HH:mm:ss" in UTC. |
String |
getTimeStamp()
Returns a String representing the current date and time as a timestamp of the form "yyyy-MM-dd'T'HH:mm:ss" in UTC. |
String |
getTimeStamp(Date date)
Returns a String representing the provided date and time as a timestamp of the form "yyyy-MM-dd'T'HH:mm:ss" in UTC. |
String |
getTimeStampId()
Returns a String representing the current date and time as a timestamp of the form "yyyy-MM-dd'T'HH_mm_ss" in UTC. |
String |
getTimeStampId(Date date)
Returns a String representing the provided date and time as a timestamp of the form "yyyy-MM-dd'T'HH_mm_ss" in UTC. |
String |
getTimeString(long millis)
Returns a properly-formatted, localized String describing the number of hours, minutes and seconds represented by a long value in milliseconds. |
Date |
parseTimeStamp(String timeStamp)
Returns a Date created by parsing the provided String in a timestamp of the form "yyyy-MM-dd'T'HH:mm:ss" in UTC. |
| Field Detail |
|---|
static final int FIELD_CENTURY
static final int FIELD_DECADE
static final int FIELD_YEAR
static final int FIELD_MONTH
static final int FIELD_WEEK
static final int FIELD_DAY
static final int FIELD_HOUR
static final int FIELD_MINUTE
static final int FIELD_SECOND
| Method Detail |
|---|
String getTimeStamp(Date date)
String getFriendlyTimeStamp(Date date)
String getDateStamp(Date date)
Date parseTimeStamp(String timeStamp)
throws ParseException
ParseExceptionString getTimeStampId(Date date)
String getCurrentDate(int UTCOffset)
String getTimeStamp()
String getTimeStampId()
String getDCDateStamp()
String getCurrentDate(int UTCOffset,
String dateformat)
SimpleDateFormat,
GregorianCalendar
String getCurrentDate(int UTCOffset,
String dateformat,
Date date)
SimpleDateFormat,
GregorianCalendarString getTimeString(long millis)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||