Source Code : Convert java.sql.Timestamp to long for easy compare
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Convert java.sql.Timestamp to long for easy compare
public class DateLabel {
public static void main(String[] args) {
java.util.Date today = new java.util.Date();
java.sql.Timestamp ts1 = new java.sql.Timestamp(today.getTime());
java.sql.Timestamp ts2 = java.sql.Timestamp.valueOf("2005-04-06 09:01:10");
long tsTime1 = ts1.getTime();
long tsTime2 = ts2.getTime();
System.out.println(tsTime1);
System.out.println(tsTime2);
}
}
Thank with us