开发者

android sqlite timestamp column

I have开发者_如何学Go an Android SQLite table that has 5 columns in it. One of them is a timestamp. How can I check the timestamp (yyyy-mm-dd hh:mm:ss) for all of them and compare it to the local time on the Android then decide which row to read?


You can have a look at the sql date functions : http://www.sqlite.org/lang_datefunc.html

And you can obtain your local datetime with "new Date()" in Java.

In my application, I usually store unix timestamp and I can do operations I need quite easily with "new Date().getTimeinMillis()". It's simpler and more performant.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜