From the course: SQL Essential Training

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Date functions

Date functions

- [Speaker] Now date functions allow us to manipulate data that's stored in various date and time formats. Now, if you recall within our WSDA Music database the dates that we have stored in this database are stored in both date and time. And that is year, month, day followed by hour, minute, and second. Now, let's say that we were tasked by the management at WSDA Music to calculate the employees ages. That is, we need to leverage the birth date field to calculate each employee's age. Now, to do this, we need to find out the difference between the current date and the employee's birthdate. To perform such a calculation, we can employ a new date function which is called the strftime. And, the strftime function converts date and time strings into another format. So, to operate this function properly, you need to pass into it two arguments, and that is, first, you need to pass in your desired format, that is the…

Contents