Home | History | Annotate | Download | only in sql

Lines Matching refs:Timestamp

32  * the JDBC API to identify this as an SQL <code>TIMESTAMP</code> value.
34 * to hold the SQL <code>TIMESTAMP</code> fractional seconds value, by allowing
36 * A Timestamp also provides formatting and
37 * parsing operations to support the JDBC escape syntax for timestamp values.
39 * <p>The precision of a Timestamp object is calculated to be either:
43 * of characters in the yyyy-mm-dd hh:mm:ss.[fff...] and <code>s</code> represents the scale of the given Timestamp,
50 * separate. The <code>Timestamp.equals(Object)</code> method never returns
52 * that isn't an instance of <code>java.sql.Timestamp</code>,
54 * As a result, the <code>Timestamp.equals(Object)</code>
61 * Due to the differences between the <code>Timestamp</code> class
64 * <code>Timestamp</code> values generically as an instance of
66 * inheritance relationship between <code>Timestamp</code>
70 public class Timestamp extends java.util.Date {
73 * Constructs a <code>Timestamp</code> object initialized
83 * @deprecated instead use the constructor <code>Timestamp(long millis)</code>
87 public Timestamp(int year, int month, int date,
97 * Constructs a <code>Timestamp</code> object
101 * the <code>Timestamp</code> object.
108 public Timestamp(long time) {
118 * Sets this <code>Timestamp</code> object to represent a point in time that is
123 * @see #Timestamp(long time)
137 * represented by this <code>Timestamp</code> object.
155 * Converts a <code>String</code> object in JDBC timestamp escape format to a
156 * <code>Timestamp</code> value.
158 * @param s timestamp in format <code>yyyy-[m]m-[d]d hh:mm:ss[.f...]</code>. The
162 * @return corresponding <code>Timestamp</code> value
166 public static Timestamp valueOf(String s) {
188 String formatError = "Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]";
263 return new Timestamp(year - 1900, month - 1, day, hour, minute, second, a_nanos);
267 * Formats a timestamp in JDBC timestamp escape format.
366 * Gets this <code>Timestamp</code> object's <code>nanos</code> value.
368 * @return this <code>Timestamp</code> object's fractional seconds component
376 * Sets this <code>Timestamp</code> object's <code>nanos</code> field
392 * Tests to see if this <code>Timestamp</code> object is
393 * equal to the given <code>Timestamp</code> object.
395 * @param ts the <code>Timestamp</code> value to compare with
396 * @return <code>true</code> if the given <code>Timestamp</code>
397 * object is equal to this <code>Timestamp</code> object;
400 public boolean equals(Timestamp ts) {
413 * Tests to see if this <code>Timestamp</code> object is
418 * signature of <code>Timestamp.equals(Timestamp)</code> and to preserve backward
426 * of a <code>Timestamp</code> that
427 * is equal to this <code>Timestamp</code> object;
431 if (ts instanceof Timestamp) {
432 return this.equals((Timestamp)ts);
439 * Indicates whether this <code>Timestamp</code> object is
440 * earlier than the given <code>Timestamp</code> object.
442 * @param ts the <code>Timestamp</code> value to compare with
443 * @return <code>true</code> if this <code>Timestamp</code> object is earlier;
446 public boolean before(Timestamp ts) {
451 * Indicates whether this <code>Timestamp</code> object is
452 * later than the given <code>Timestamp</code> object.
454 * @param ts the <code>Timestamp</code> value to compare with
455 * @return <code>true</code> if this <code>Timestamp</code> object is later;
458 public boolean after(Timestamp ts) {
463 * Compares this <code>Timestamp</code> object to the given
464 * <code>Timestamp</code> object.
466 * @param ts the <code>Timestamp</code> object to be compared to
467 * this <code>Timestamp</code> object
468 * @return the value <code>0</code> if the two <code>Timestamp</code>
470 * <code>Timestamp</code> object is before the given argument;
472 * <code>Timestamp</code> object is after the given argument.
475 public int compareTo(Timestamp ts) {
491 * Compares this <code>Timestamp</code> object to the given
495 * this <code>Timestamp</code> object
496 * @return the value <code>0</code> if this <code>Timestamp</code> object
498 * if this <code>Timestamp</code> object is before the given argument;
500 * <code>Timestamp</code> object is after the given argument.
505 if(o instanceof Timestamp) {
506 // When Timestamp instance compare it with a Timestamp
507 // Hence it is basically calling this.compareTo((Timestamp))o);
508 // Note typecasting is safe because o is instance of Timestamp
509 return compareTo((Timestamp)o);
513 Timestamp ts = new Timestamp(o.getTime());