Java Timestamp.before(Timestamp ts)

Syntax

Timestamp.before(Timestamp ts) has the following syntax.

public boolean before(Timestamp ts)

Example

In the following code shows how to use Timestamp.before(Timestamp ts) method.


public class Main {
  public static void main(String[] args) {
    java.sql.Timestamp ts1 = java.sql.Timestamp.valueOf("2012-04-06 09:01:10");
    java.sql.Timestamp ts2 = java.sql.Timestamp.valueOf("2013-04-06 09:01:10");
    // ww  w.jav a 2  s .c  om
    System.out.println(ts1.before(ts2));

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.sql »




DatabaseMetaData
ParameterMetaData
PreparedStatement
ResultSet
Timestamp