MySQL FROM_DAYS() function
MySQL FROM_DAYS() returns a date against a datevalue. It takes the number of days since year 0 as an argument and returns the corresponding date.
This function is useful in -
- FROM_DAYS() is useful for historical or archaeological data that uses a day count since year 0 to represent dates.
- FROM_DAYS() is helpful when dealing with date representations that are based on a numeric day count rather than the standard year-month-day format.
- The function can be used to adjust dates by a specific number of days, allowing you to calculate new dates relative to a given day count.
- FROM_DAYS() can be used to convert day counts from external sources into valid date values in MySQL.
- For systems that use Julian day counts, FROM_DAYS() can be used to convert these counts into MySQL-compatible dates.
- FROM_DAYS() is valuable when working with historical documents or records that use a day-count-based date representation.
Where N is a datevalue.
MySQL Version: 8.0
Example: MySQL FROM_DAYS() function
The following statement will return a date against the datevalue 733910.
mysql> SELECT FROM_DAYS(733910); +-------------------+ | FROM_DAYS(733910) | +-------------------+ | 2009-05-18 | +-------------------+ 1 row in set (0.00 sec)
All Date and Time Functions:
Click here to see the MySQL Date and time functions.
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join
We are closing our Disqus commenting system for some maintenanace issues. You may write to us at reach[at]yahoo[dot]com or visit us at Facebook