# Handling Dates & Times in SQLite

DevFeed: [Handling Dates & Times in SQLite](<https://devfeed.tech/articles/handling-dates-times-in-sqlite-30600.md>)

Original publisher: [Read original article](<https://ryanharter.com/blog/2020/09/handling-dates-times-in-sqlite/>)

Published: 2020-09-04T16:35:01Z

Content type: tutorial

Language: en

Sources: [Blogs on Ryan Harter](<https://devfeed.tech/sources/blogs-on-ryan-harter.md>)

Topics: [SQLite](<https://devfeed.tech/topics/sqlite.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [DateTime](<https://devfeed.tech/topics/datetime.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [timezone](<https://devfeed.tech/topics/timezone.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>)

Tags: [database](<https://devfeed.tech/tags/database.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>), [time](<https://devfeed.tech/tags/time.md>), [timezone](<https://devfeed.tech/tags/timezone.md>)

## AI overview

The article examines how to store dates and times in SQLite for a Kotlin app using Room. It explains that SQLite has no dedicated DateTime type and discusses problems with storing timestamps as Unix-epoch milliseconds, including timezone handling and query support.

## Source excerpt

As I've been refactoring a fairly large section of Pigment, my coloring book app for adults, I came across some SQL code which I haven't touched in a very long time and didn't seem quite right. Part of Pigment's large library of coloring books and pages are the Daily books, which are a different book each month in which a new page is released each day. The day's page is free only for the day (for non-subscribers), and then reverts to being locked once the next page is released. Users can unlock a page forever by simply starting a coloring project with it while it's free, but there is a limited window in which it's available.