[Solved] convert mellisecond to date and populate in listView using cursor [duplicate]


You are storing the dates in the SQL database as text strings, but then asking SQL to return values between to limits and expecting it to interpret those limits as dates when it hasn’t been told that they are dates and wouldn’t know how to interpret the text format as a date if it did know they were dates.

Use Date.getTime() to convert the dates to long values and store those in SQL as numbers. Similarly convert your start and end times to long values, and ask SQL to return records between those values. Any time you need to convert what is stored in SQL back into a user-friendly date, use the Date(long value) constructor and pass it the number that SQL gives you.

1

solved convert mellisecond to date and populate in listView using cursor [duplicate]