Flash cards
Review the key moves
1/4
Core idea
What is the main idea behind MySQL TO_DAYS() Function?
Lesson checks
Practice each idea before moving on
Short Mimo-style checks built from this lesson's code, terms, and sequence.
1Quick choice
Which statement best captures the main point of this lesson?
2Fill blank
Complete the missing token from the example code.
___ TO_DAYS("2017-06-20");3Order
Put the learning moves in the order that makes the concept easiest to apply.
The TO_DAYS() function returns the number of days between a date and year 0 (date "0000-00-00").
Definition and Usage
MySQL TO_DAYS() Function
Example
SELECT TO_DAYS("2017-06-20");Definition and Usage
The TO_DAYS() function returns the number of days between a date and year 0 (date "0000-00-00").
The TO_DAYS() function can be used only with dates within the Gregorian calendar.
Note
This function is the opposite of the FROM_DAYS() function.
Syntax
TO_DAYS(
date
)Parameter Values
| Parameter | Description |
|---|---|
| date | Required. The given date |
Technical Details
| Works in: | From MySQL 4.0 |
|---|