utc
Applies the utc modifier to a date/time value, interpreting it as Coordinated Universal Time (UTC).
This utc modifier is the inverse of localtime. It is used to ensure that a time value which is in the local time zone is treated as UTC for subsequent operations. For example, if you have a local time string like '2024-07-15 10:00:00' and your local time is UTC-5, applying utc() will cause SQLite to interpret this as if it were '2024-07-15 15:00:00' UTC when performing calculations.
This modifier has no effect if the time value is already in UTC (e.g., if it has a 'Z' suffix).
Example
// Assume a local time string is stored and needs to be converted to a UTC-based Unix timestamp.
select(DATETIME("2024-07-15 10:00:00").utc().unixepoch()).execute()Content copied to clipboard
Return
A KQLiteColumn with the 'utc' modifier applied.
Author
MOHAMMAD AZIM ANSARI