Mysql Date to Number

We already illustrate with an example of Current Date and Time in Mysql. Now this tutorial illustrate an example for Mysql Date to Number.

Mysql Date to Number

Mysql Date to Number

     

We already illustrate with an example of Current Date and Time in Mysql. Now this tutorial illustrate an example for  Mysql Date to Number. To grasp this example, we use the given Mysql Query that return you the Date to Number.

now ( ) +0 as number : The Query return you the current date to a number in number field name.

Query for converting current date and time to number:-

 

 

 

mysql> select now()+0 as number;

Output:-

+-----------------------+
| number                |
+-----------------------+
| 20081222170227.000000 |
+-----------------------+
1 row in set (0.00 sec)