How to use MySQL FROM_UNIXTIME() function to return datetime value in numeric format?

MySQLMySQLi Database

As we know that we can convert a time of datetime value to an integer by adding 0(+0) to them. In a similar way, we can convert the datetime value returned by FROM_UNIXTIME() function in numeric format. The following example will clarify it more −

mysql> Select FROM_UNIXTIME(1555033470)+0 AS 'Date in Numeric Format';
| Date in Numeric Format |
| 20190412071430.000000  |
1 row in set (0.00 sec)

After adding 0 (+0) to datetime value MySQL returns the numeric value up to 6 digits microseconds.

Updated on 30-Jan-2020 05:59:45