Get startedGet started for free

Manipulating the current date and time

Most of the time when you work with the current date and time, you will want to transform, manipulate, or perform operations on the value in your queries. In this exercise, you will practice adding an INTERVAL to the current timestamp as well as perform some more advanced calculations.

Let's practice retrieving the current timestamp. For this exercise, please use CURRENT_TIMESTAMP instead of the NOW() function and if you need to convert a date or time value to a timestamp data type, please use the PostgreSQL specific casting rather than the CAST() function.

This exercise is part of the course

Functions for Manipulating Data in PostgreSQL

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

--Select the current timestamp without timezone
SELECT ___::___ AS ___;
Edit and Run Code