We’ll begin with dates. Dates are often written in the following format

1. Date: YYYY-MM-DD

2. Datetime or Timestamp: YYYY-MM-DD hh:mm:ss

We can use SQL’s date functions to transform data into a desired format. Since date functions can be database specific, verify the functions that exist on your relational database management system.

For example, this statement

SELECT DATETIME(manufacture_time) FROM baked_goods;

Would return the date and time for the manufacture_time column.



Using the datetime function, select the date and time of all deliveries in the baked_goods table using the column delivery_time.

Sign up to start coding

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?