Can you please help in matter:
I have defined a variable which is:
Time from_time = rs.getTime("nfrm_time");
and it will read the values 7:15:00
How to convert this type to seconds?
Call getTime
to get the number of milliseconds since January 1, 1970. Divide by 1000 to get it in seconds:
long unixTime = from_time.getTime() / 1000;
To get the number of seconds since 00:00 of the current day, use the
Calendar c = Calendar();
c.setTime(from_time);
long daySeconds = (c.get(Calendar.SECONDS) +
c.get(Calendar.MINUTES) * 60 +
c.get(Calendar.HOURS) * 3600);
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