webCOMAND

TIMEDIFF()

Return the difference in seconds between two time/timestamp values.

Prototype

integer TIMEDIFF(mixed $end, mixed $start)

Parameters

  • end - A time ("HH:MM:SS") or timestamp ("YYYY-MM-DD HH:MM:SS").
  • start - A time ("HH:MM:SS") or timestamp ("YYYY-MM-DD HH:MM:SS").

Return

The positive or negative number of seconds between end and start, or NULL if there is an error, such as an invalid timestamp.

Example

SELECT OID, TIMEDIFF(NOW(), META(LastModified)) AS ModifiedSecondsAgo FROM User

See Also

DATEDIFF()