SQL • LESSON 33

CURRENT_DATE & CURRENT_TIMESTAMP

Learn how to retrieve the current date and timestamp from SQL.

🟠 Intermediate⏱ 3 Minutes⭐ 520 XP
🤔 THE QUESTION

How can we get today's date or the current date and time directly from SQL?

💡 WHAT IS IT?

CURRENT_DATE returns the current date, while CURRENT_TIMESTAMP returns the current date and time.

🎯 WHAT IS IT USED FOR?

They are useful for audit columns, reports, filtering recent records, tracking when queries run, and comparing data against today's date.

💻 EXAMPLE
SELECT
CURRENT_DATE AS today,
CURRENT_TIMESTAMP AS current_time;

Mission Brief

Practice retrieving the current date and timestamp using SQL.

Objectives

  • CURRENT_DATE
  • CURRENT_TIMESTAMP
  • Date values
  • Timestamp values
  • Column aliases