-
Notifications
You must be signed in to change notification settings - Fork 0
TimeStamp
yaxing edited this page Dec 1, 2011
·
5 revisions
nyu/ads/conctrl/entity/TimeStamp.java
Extended from Timestamp (http://download.oracle.com/javase/6/docs/api/java/sql/Timestamp.html)
Just use a new constructor so that it is easier to create a timestamp of current time.
Usage:
TimeStamp t1 = new TimeStamp(); // return a TimeStamp object of current time.
t1.compareTo(Timestamp t2); //comparing two time stamp
long time = t1.getTime(); //convert TimeStamp obj to long to be passed between tm and sites
TimeStamp now = new TimeStamp(time); // long -> TimeStamp
other usage please refer to http://download.oracle.com/javase/6/docs/api/java/sql/Timestamp.html