Retrieve date wise data from database in Android

后端 未结 2 418
梦如初夏
梦如初夏 2021-01-07 04:10

In my database I have 1 table with date as one of the column, which stores the date when user add some data in my table.

Now I want to retrieve the data

2条回答
  •  失恋的感觉
    2021-01-07 05:13

    Android doesn't have a bulit in data type as "Date". You can either store it as string and parse it appropriately when you use it. So with this option, unless you retrive and parse the Date , you won't be able to find the records in current month.

    Other option is you store it as number - Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC.

    With some calculation in the where clause you can find out the records for the current month.

提交回复
热议问题