1

I have 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?

1
  • Do you want to compare Timestamp value with the current date? Commented Mar 15, 2011 at 15:15

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.