v.21.3New Feature
Added timezoneOffset function to return UTC offset in seconds
Added timezoneOffset(datetime) function which will give the offset from UTC in seconds. This close #issue:19850. #19962 (keenwolf).Why it matters
This feature provides users with a simple way to obtain the time zone offset from UTC as a numeric value in seconds, which helps when working with time zone conversions, calculations, or displays that require an explicit offset representation.How to use it
Use the function by passing adatetime value to timezoneOffset(datetime). It will return the offset from UTC in seconds. For example:SELECT timezoneOffset(toDateTime('2024-01-01 12:00:00')) AS offset_seconds;