Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
One of the powerful features in SQL is writing queries based on today's date and time. We'll use a function to get today's date.
SQLite
To get the current date use: DATE("now")
To get the current time use: TIME("now")
To get the current date time: DATETIME("NOW")
MS SQL
To get the current date use: CONVERT(date, GETDATE())
To get the current time use: CONVERT(time, GETDATE())
To get the current date time: GETDATE()
MySQL
To get the current date use: CURDATE()
To get the current time use: CURTIME()
To get the current date time: NOW()
Oracle and PostgreSQL
To get the current date use: CURRENT_DATE
To get the current time use: CURRENT_TIME
To get the current date time: `CURRENT_TIMESTAMP
Cheat Sheets
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Neil Bircumshaw
Full Stack JavaScript Techdegree Student 14,597 Points3 Answers
-
Rifqi Fahmi
23,164 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up