Format integer to formatted date in an SQLite select statement

后端 未结 3 1029
梦如初夏
梦如初夏 2020-12-19 13:08

I have an SQLite database within my Android application, which stores dates as integers. These integers are derived from a call to Java.util.Date.getTime();. I

3条回答
  •  醉酒成梦
    2020-12-19 13:46

    SQLite uses static rigid typing. With static typing, the datatype of a value is determined by its container - the particular column in which the value is stored.

    Any value stored in the SQLite database has one of the following storage class:

    1. NULL
    2. INTEGER
    3. REAL
    4. TEXT
    5. BLOB

    so I am not sure what you meant by but the date is stored as a long, unhelpful integer.

    For more details please refer to Datatypes In SQLite Version 3. For further information on storing date/time in SQLite please refer to SQL As Understood By SQLite.

    I hope this helps.

提交回复
热议问题