开发者

How to convert Time to Long?

开发者 https://www.devze.com 2023-03-07 05:28 出处:网络
Fo开发者_开发百科r ex., I have the following value: Time.valueOf(\"2:00:00\") how should I convert it to Long? (to be stored in SQLite database as Real)

Fo开发者_开发百科r ex., I have the following value:

Time.valueOf("2:00:00")

how should I convert it to Long? (to be stored in SQLite database as Real)

java.sql.Time is used.


Use getTime():

Time t = Time.valueOf("2:00:00");
long l = t.getTime();
0

精彩评论

暂无评论...
验证码 换一张
取 消