Loading section...

CURRENT_TIMESTAMP function

Using CURRENT_TIMESTAMP Basic Usage Here is the simplest way to retrieve the current timestamp. The result captures the exact moment the query executed. This precision is essential for audit trails, event logging, and any situation where knowing the precise time matters. Practical Applications Recording Event Times Adding timestamps to records creates an audit trail of when events occurred. Each record gets the same timestamp within a single query. This is intentional, ensuring consistency within a transaction. Recent Activity Queries This query finds users who logged in within the last 24 hours. The time window moves forward continuously, always showing the most recent 24-hour period.