I am having a variable which is called from_time and I am reading the infor from the DB.
Time from_time = rs.getTime("nfrm_time");
How to convert the from_time into milliseconds and seconds?
Thanks for the help
java.sql.Time extends java.util.Date, and has getTime() method which returns millis.
You should use the method getTime():
public class Main
{
public static void main(String[] args)
{
Time t = new Time(System.currentTimeMillis());
long l = t.getTime();
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With