de.esprit.appsuite.database.dbase

## Class DBTimestamp

- java.lang.Object
- - java.util.Date
  - - java.sql.Timestamp
    - - de.esprit.appsuite.database.dbase.DBTimestamp

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<java.util.Date>

      public class DBTimestamp
      extends java.sql.Timestamp

  This is an extension of `Timestamp`. It has the toString() method overridden in order to ensure a generalized timestamp format (useful for SQL statements).
  Author:
    Rainer Buesch
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DBTimestamp()`
    `DBTimestamp(java.util.Date date)`
    `DBTimestamp(java.sql.Date date)`
    `DBTimestamp(int year, int month, int day, int hour, int minute, int second)`
    `DBTimestamp(long millis)`
    `DBTimestamp(java.lang.String timestampStr)` Expected format is yyyy-MM-dd hh:mm:ss

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.text.DateFormat` | `getFormat()`
    `static java.lang.String` | `getFormatString()`
    `static DBTimestamp` | `parseTimestampValue(java.lang.String tsStr)` Creates a DBTimestamp object from the given string.
    `java.lang.String` | `toDateString()` Output format is yyyy-MM-dd
    `static java.lang.String` | `toNeutralFormat(java.util.Date ts)` Formats the timestamp value according to 'yyyy-MM-dd HH:mm:ss'
    `java.lang.String` | `toString()` Output format is yyyy-MM-dd HH:mm:ss
    `java.lang.String` | `toTimeString()` Output format is HH:mm:ss

    - ### Methods inherited from class java.sql.Timestamp

      `after, before, compareTo, compareTo, equals, equals, getNanos, getTime, hashCode, setNanos, setTime, valueOf`

    - ### Methods inherited from class java.util.Date

      `after, before, clone, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTimezoneOffset, getYear, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setYear, toGMTString, toLocaleString, UTC`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DBTimestamp

          public DBTimestamp(long millis)

    - #### DBTimestamp

          public DBTimestamp()

    - #### DBTimestamp

          public DBTimestamp(java.util.Date date)

    - #### DBTimestamp

          public DBTimestamp(java.sql.Date date)

    - #### DBTimestamp

          public DBTimestamp(int year,
                     int month,
                     int day,
                     int hour,
                     int minute,
                     int second)

    - #### DBTimestamp

          public DBTimestamp(java.lang.String timestampStr)

      Expected format is yyyy-MM-dd hh:mm:ss

  - ### Method Detail

    - #### toString

          public java.lang.String toString()

      Output format is yyyy-MM-dd HH:mm:ss
      Overrides:
        `toString` in class `java.sql.Timestamp`

    - #### toDateString

          public java.lang.String toDateString()

      Output format is yyyy-MM-dd

    - #### toTimeString

          public java.lang.String toTimeString()

      Output format is HH:mm:ss

    - #### getFormatString

          public static java.lang.String getFormatString()

    - #### getFormat

          public static java.text.DateFormat getFormat()

    - #### parseTimestampValue

          public static DBTimestamp parseTimestampValue(java.lang.String tsStr)
                                                 throws java.text.ParseException

      Creates a DBTimestamp object from the given string. The string must be formatted according to the NEUTRAL_TIMESTAMP_FORMAT.
      Throws:
        `java.text.ParseException`

    - #### toNeutralFormat

          public static java.lang.String toNeutralFormat(java.util.Date ts)

      Formats the timestamp value according to 'yyyy-MM-dd HH:mm:ss'

Copyright © 2014 EsprIT-Systems. All Rights Reserved.