datetime('now') provides you the current date and time in UTC, as well as the SQLite equivalent of MySQL UTC_TIMESTAMP() .
It may also be useful to know that given the date and time, a datetime string can convert it from localtime to UTC using datetime('2011-09-25 18:18', 'utc') .
You can also use the datetime() function to apply modifiers such as +1 day, beginning of month, 10 years, and many others.
Therefore, your example would look like this: SQLite:
SELECT mumble FROM blah WHERE blah.heart_beat_time > datetime('now', '-600 seconds');
You can find more modifiers on the SQLite Date and Time Functions page.
Rikki
source share