FROM_UNIXTIME/UNIX_TIMESTAMP: transformations between MySQL dates (DATE, DATETIME, and TIMESTAMP) and Unix tim : FROM_UNIXTIME « Date Time « SQL / MySQL






FROM_UNIXTIME/UNIX_TIMESTAMP: transformations between MySQL dates (DATE, DATETIME, and TIMESTAMP) and Unix tim

     
estamps:
mysql>
mysql>
mysql> SELECT NOW(), UNIX_TIMESTAMP(NOW());
+---------------------+-----------------------+
| NOW()               | UNIX_TIMESTAMP(NOW()) |
+---------------------+-----------------------+
| 2011-10-03 10:22:37 |            1317666157 |
+---------------------+-----------------------+
1 row in set (0.00 sec)

mysql>

   
    
    
    
    
  








Related examples in the same category

1.Using FROM_UNIXTIME
2.To preserve accuracy with DATETIME or TIMESTAMP values, use UNIX_TIMESTAMP( ) and FROM_UNIXTIME( ) instead.