As we all know, we can convert the time of a datetime value into an integer by adding 0( 0). In a similar way, we can convert the datetime value returned by FROM_UNIXTIME() function into numeric format. The following example will illustrate this more clearly -
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 the datetime value, MySQL returns a value with up to 6 microseconds.
The above is the detailed content of How to return datetime value in numeric format using MySQL FROM_UNIXTIME() function?. For more information, please follow other related articles on the PHP Chinese website!