How to convert Time to Long?
18,949
Use getTime():
Time t = Time.valueOf("2:00:00");
long l = t.getTime();
Author by
LA_
To search in your posts only type: user:me text To list all your unaccepted questions, type: user:me hasaccepted:0 My questions list: link
Updated on July 10, 2022Comments
-
LA_ almost 2 years
For ex., I have the following value:
Time.valueOf("2:00:00")
how should I convert it to
Long
? (to be stored in SQLite database asReal
)java.sql.Time
is used. -
Andriya almost 5 yearsIt shows the wrong long value i mean it returns wrong timestamp value. Time t = Time.valueOf("05:50:00"); l = t.getTime(); but i get l as 1200000 this is not timestamp for that