SQLite UNIXEPOCH() Function
Definition and Usage
The UNIXEPOCH() function returns a date as a Unix timestamp: the number of seconds since 1970-01-01 00:00:00 UTC.
Note: To turn a Unix timestamp back into a date, use the 'unixepoch' modifier: DATE(836438400, 'unixepoch').
Syntax
UNIXEPOCH(time_value, modifier, ...)
Parameter Values
| Parameter | Description |
|---|---|
| time_value | Optional. A date or time. Default is 'now' |
| modifier | Optional. Modifiers that change the date or time, like '+7 days', '-1 month', 'start of month', 'start of year', 'weekday 0' (the next Sunday) and 'localtime' |
Technical Details
| Return type: | Integer |
|---|---|
| Works in: | SQLite 3.38.0 and later |