0

So I'd like to store database entries in an Android SQLite db with a time component and then be able to later select entries between certain months or days with a calendar. What is the best way to do this? I thought about putting the date in the database in a year, month and day column so I use SQL commands to find a date range, but I'd like to do this the right way the first time. How would I later pull out data between two random dates? Thanks.

Mark

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Matt
  • 51
  • 5
  • 1
    Store milliseconds. – earthw0rmjim May 06 '18 at 16:37
  • 3
    Store TimeStrings. And use Google, before asking this kind of questions. – Phantômaxx May 06 '18 at 16:44
  • So if I used miliseconds how would I pull up results from a db between two dates? And what function would I use to get the current time into that format? Do the two answers above use the same method or different methods? PS. I did use Google and there seem to be a hundred different answers and many are very old that's why I posted. – Matt May 06 '18 at 17:08
  • 1
    `... many are very old ...` but **still valid**. – Phantômaxx May 06 '18 at 18:21

0 Answers0