SQL Date and Time Functions — a practical guide to SQL date time functions with clear examples you can reuse in real projects.
SQL Tutorial Series (42/100). Prefer one article? Read the complete SQL tutorial.
Short description
Store UTC when possible; convert for display in the app layer.
Dates (MySQL-style)
SELECT id, created_at
FROM orders
WHERE created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY);