second() function

Extract the seconds from a datetime or time, or the number of seconds from a Interval

Syntax

second(datetime)
second(Interval)

Arguments

date - is datetime or time. The date to extract the second from.
Interval - is Interval. The Interval to return the number of seconds from.

Example

second('2012-07-22T13:24:57') → 57
second(tointerval('3 seconds')) → 3
second(age('2012-07-22T00:20:00','2012-07-22T00:00:00')) → 1200
second(age('2012-01-01','2010-01-01')) → 63072000