SQLite 3 reference · Date and Time Functions
SQLite TIME() Function
Return the time part of a date/time as text in HH:MM:SS form, optionally shifted with modifiers.
SQLite 3
Syntax
time(time-value, modifier, ...)
Parameters
| Parameter | Description |
|---|---|
time-value |
A date/time: 'YYYY-MM-DD', 'YYYY-MM-DD HH:MM:SS', 'now', a Julian day number, or a Unix time with the 'unixepoch' modifier. |
modifiers optional |
Adjustments applied left to right, such as '+1 day', '-3 months', 'start of month', 'weekday 1', 'localtime', 'unixepoch'. |
Return value
Text HH:MM:SS, or NULL.
Examples
SELECT time('2026-01-05 14:30:59') AS t,
time('14:30', '+90 minutes') AS later;
Output
t | later 14:30:59 | 16:00:00
SELECT time('2026-01-05 10:00:00.250', 'subsec') AS with_ms;
Output
with_ms 10:00:00.250
Related
DATE()· Return a date as text in YYYY-MM-DD form, optionally shifted with modifiers like '+7 days' or 'start of month'.DATETIME()· Return a date and time as text in YYYY-MM-DD HH:MM:SS form, optionally shifted with modifiers.STRFTIME()· Format a date/time with % codes, such as %Y year, %m month, %d day, %H hour, %W week and %w weekday.- SQL Date Functions · tutorial