Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Dealing with dates
Working with time
Date and time data types in PostgreSQL
Extracting dates and times
Timezone conversion
Format date and time
Current date and time data
45. The CURRENT_DATE and CURRENT_TIME functions


Good job! You can individually pull the local time or the local date with the CURRENT_DATE and CURRENT_TIME functions. The query below gets the current date and time:


It returns the current date and time (with the time zone and full precision of fractional seconds), respectively.


Do you know how long until our flights arrive in hours? Check the difference between the current and arrival time of the routes. Select the route code and the difference of time between the arrival and now. Name this column difference_hours.

Stuck? Here's a hint!

Use this expression:

DATE_PART('hour', CURRENT_TIMESTAMP) - DATE_PART('hour', arrival_time) AS difference_hours