Skip to content

Commit

Permalink
Note on sqlite dates.
Browse files Browse the repository at this point in the history
  • Loading branch information
coleifer committed Feb 5, 2015
1 parent 8ca0b56 commit b973088
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/peewee/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ have an event attached:
(Event.event_date.year == now.year) &
(Event.event_date.month == now.month))
.. note::
SQLite does not have a native date type, so dates are stored in formatted text columns. To ensure that comparisons work correctly, the dates need to be formatted so they are sorted lexicographically. That is why they are stored, by default, as ``YYYY-MM-DD HH:MM:SS``.

Creating a custom field
^^^^^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit b973088

Please sign in to comment.