Mysql From_days Function

MySQL: FROM_DAYS Function

This tutorial explains how to use the MySQL FROM_DAYS function with syntax and examples.

Description

The MySQL FROM_DAYS function takes a numeric representation of the day and returns a date value.

Syntax

The syntax for the FROM_DAYS function in MySQL is:

FROM_DAYS( numeric_day )

Parameters or Arguments

numeric_day

The numeric day to convert to a date.

Note

  • The FROM_DAYS function is to be used only with dates within the Gregorian calendar.
  • See also the TO_DAYS function which is the reverse of the FROM_DAYS function.

Applies To

The FROM_DAYS function can be used in the following versions of MySQL:

  • MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

Example

Let's look at some MySQL FROM_DAYS function examples and explore how to use the FROM_DAYS function in MySQL.

For example:

mysql> SELECT FROM_DAYS(736038);
Output: 2015-03-16

mysql> SELECT FROM_DAYS(736039);
Output: 2015-03-17

mysql> SELECT FROM_DAYS(736040);
Output: 2015-03-18