|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.data.DateAndTime
public class DateAndTime
A representation of a date and time as day, month, year, and time of day.
This class is designed as a simpler alternative to Date,
which has a number of problems and inconveniences.
Copyright 1997-2006 Partner Software, Inc.
Date,
Time| Field Summary | |
|---|---|
static java.text.DateFormat |
format
|
| Constructor Summary | |
|---|---|
DateAndTime()
Creates a new DateAndTime corresponding to the current date and time. |
|
DateAndTime(java.util.Date dateAndTime)
Creates a new DateAndTime from the given java.util.Date object. |
|
DateAndTime(long millis)
Creates a new DateAndTime for the given milliseconds since the epoc (same as java.util.Date convention). |
|
DateAndTime(java.lang.String dateAndTimeString)
Creates a new DateAndTime from the given String. |
|
DateAndTime(java.sql.Timestamp dateAndTime)
Creates a new DateAndTime from the given java.sql.Timestamp object. |
|
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object nother)
|
boolean |
equals(java.lang.Object nother)
Casts passed object to DateAndTime and compares to this object. |
java.lang.String |
format(java.lang.String formatString)
Format this DateAndTime as a String using the usual Java SimpleDateFormat syntax. |
Date |
getDate()
Returns the date portion of this DateAndTime. |
long |
getMillis()
Returns the internal millisecond representation (same format java.util.Date uses). |
Time |
getTime()
Returns the time portion of this DateAndTime. |
java.sql.Date |
toJavaSqlDate()
|
java.sql.Timestamp |
toJavaSqlTimestamp()
|
java.util.Date |
toJavaUtilDate()
A normal Date object representing this DateAndTime. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.text.DateFormat format
| Constructor Detail |
|---|
public DateAndTime()
public DateAndTime(long millis)
public DateAndTime(java.lang.String dateAndTimeString)
dateAndTimeString -
java.lang.IllegalArgumentException - if it can't parse the input.public DateAndTime(java.util.Date dateAndTime)
dateAndTime - a java.util.Date representing the desired date and time.public DateAndTime(java.sql.Timestamp dateAndTime)
dateAndTime - a java.sql.Timestamp representing the desired date and time.| Method Detail |
|---|
public java.util.Date toJavaUtilDate()
Date object representing this DateAndTime.
public Date getDate()
public Time getTime()
public long getMillis()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object nother)
equals in class java.lang.Objectpublic int compareTo(java.lang.Object nother)
compareTo in interface java.lang.Comparablepublic java.lang.String format(java.lang.String formatString)
formatString -
public java.sql.Timestamp toJavaSqlTimestamp()
public java.sql.Date toJavaSqlDate()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||