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.
精彩评论