Java Timestamp.toString()
Syntax
Timestamp.toString() has the following syntax.
public String toString()
Example
In the following code shows how to use Timestamp.toString() method.
public class Main {
public static void main(String[] args) {
java.sql.Timestamp ts2 = java.sql.Timestamp.valueOf("2005-04-06 09:01:10");
/*from ww w . j a v a 2 s .c o m*/
System.out.println(ts2.toString());
}
}
The code above generates the following result.