|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.content.DCDate
public class DCDate
Dublin Core date utility class
Dates in the DSpace database are held in the ISO 8601 format. They are always stored in UTC, converting to and from the current time zone.
YYYY-MM-DDThh:mm:ss
There are four levels of granularity, depending on how much date information is available.
Examples: 1994-05-03T15:30:24,1995-10-04,
2001-10,1975
| Constructor Summary | |
|---|---|
DCDate()
Construct a clean date |
|
DCDate(Date date)
Construct a date object from a Java Date object. |
|
DCDate(String fromDC)
Construct a date from a Dublin Core value |
|
| Method Summary | |
|---|---|
static DCDate |
getCurrent()
Get a date representing the current instant in time. |
int |
getDay()
Get the day, adjusting for current time zone. |
int |
getDayGMT()
Get the day in GMT. |
int |
getHour()
Get the hour, adjusting for current time zone. |
int |
getHourGMT()
Get the hour in GMT. |
int |
getMinute()
Get the minute, adjusting for current time zone. |
int |
getMinuteGMT()
Get the minute in GMT. |
int |
getMonth()
Get the month, adjusting for current time zone. |
int |
getMonthGMT()
Get the month in GMT. |
static String |
getMonthName(int m,
Locale locale)
Get a month's name for a month between 1 and 12. |
int |
getSecond()
Get the second, adjusting for current time zone. |
int |
getSecondGMT()
Get the second in GMT. |
int |
getYear()
Get the year, adjusting for current time zone. |
int |
getYearGMT()
Get the year in GMT. |
void |
setDateLocal(int yyyy,
int mm,
int dd,
int hh,
int mn,
int ss)
Set the date. |
Date |
toDate()
Get the date as a Java Date object |
String |
toString()
Get the date as a string to put back in the Dublin Core |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DCDate()
public DCDate(String fromDC)
fromDC - the date string, in ISO 8601 (no timezone, always use UTC/GMT)public DCDate(Date date)
Date object.
date - the Java Date object.| Method Detail |
|---|
public static DCDate getCurrent()
public String toString()
toString in class Objectpublic Date toDate()
public void setDateLocal(int yyyy,
int mm,
int dd,
int hh,
int mn,
int ss)
yyyy - the yearmm - the monthdd - the dayhh - the hoursmn - the minutesss - the secondspublic int getYear()
public int getMonth()
public int getDay()
public int getHour()
public int getMinute()
public int getSecond()
public int getYearGMT()
public int getMonthGMT()
public int getDayGMT()
public int getHourGMT()
public int getMinuteGMT()
public int getSecondGMT()
public static String getMonthName(int m,
Locale locale)
m - the month number
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||