Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
SQL

SQL Date and Time Functions

Work with dates using NOW, DATE_ADD, DATE_FORMAT, and differences.

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);

Leave a reply

Your email address will not be published. Required fields are marked *