mardi 6 octobre 2015

Android sqlite date time format query

I am building a chat application where all the chats are going to have a date and time field associated with them. Now, while displaying a list of chat messages, I would like to group them according to days - something like:

<04-Oct-2015>
 Msg 1
 Msg2
<05-Oct-2015>
 Msg 1
 Msg 2
<06-Oct-2015>
 Msg 1
 Msg 2

I have two queries here:

  1. What data type should i use to store the date and time. (Integer Or Text)
  2. How to achieve the grouping of messages. (can it be done in the query itself, or do I need to post-process the query result).

Aucun commentaire:

Enregistrer un commentaire