Calculate age or duration.
Section: date and time functions
Compute the difference between two timestamps
sql
sql
SELECT TIMESTAMPDIFF(MINUTE, created_at, NOW()) AS age_minutes FROM sessions;Explanation
Useful for SLAs, queue age, and freshness calculations.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing date and time functions