I want to store a row in an SQLite 3 table for each booking in my diary.
Each row will have a ‘start time’ and a ‘end time’.
Does any one know how I can query the table for an event at a given time?
E.g. Return any rows that happen at say 10:30am
Thanks
SQLite3 doesn’t have a datetime type, though it does have date and time functions.
Typically you store dates and times in your database in something like ISO 8601 format:
YYYY-MM-DD HH:MM:SS. Then datetimes sort lexicographically into time order.With your datetimes stored this way, you simply use text comparisons such as
or