Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
The date format function is used for formatting date and time values as strings for display. We're not going to select a database for this lesson. For example, if I say SELECT DATE FORMAT, and I'll use the NOW function for current time stamp. And I'll put a FORMAT string in single quotes. And when I press Go, we get a formatted date that says Thursday, 27th of March, 2014.
The date format function takes two arguments. The first argument is a date. In this case, we're passing it the current. Time stamp with the NOW function. And the second argument is a string with formatting instructions. It's called a format string. And each of these format specifiers has a percent sign and a letter indicating what format option it represents. Here's a list of the various format specifiers available.
I suggest you experiment a lot to become familiar with it. As another example, here's a format that would give us a standard SQL date. This is. Fairly common and useful. Percent capital Y, percent m, and percent d, with dashes in between them for the year, month and day. And a space and percent capital T for the time and when I press Go that's a standard SQL. FORMAT DATE.
The date format function is used for formatting date and time values for display. I suggest you experiment a lot with the various format specifiers to familiarize yourself with them.
Get unlimited access to all courses for just $25/month.Become a member
61 Video lessons · 104776 Viewers
56 Video lessons · 116661 Viewers
71 Video lessons · 85848 Viewers
131 Video lessons · 41073 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.