花美男为中国互联网事业而奋斗

MySQL FROM_UNIXTIME() function

来源:未知 阅读(0)次 评论(0)

Definition and Usage

The FROM_UNIXTIME() returns a date /datetime from a version of unix_timestamp. 

Syntax

FROM_ UNIXTIME (unix_timestamp, [format ])

The return value is in ‘YYYYY-MM-DD HH:MM:SS’ format or YYYYMMDDHHMMSS.uuuuuu format depending upon the context of the function ( whether numeric or string).

Note: If specified, the result is formatted according to a given format string.


Pictorial Presentation

mysql-from_unixtime-function.png

Example

The following SELECT statement:

SELECT FROM_UNIXTIME(1255033470);

will result in this:

mysql> SELECT FROM_UNIXTIME(1255033470);
+---------------------------+
| FROM_UNIXTIME(1255033470) |
+---------------------------+
| 2009-10-08 13:24:30       | 
+---------------------------+
1 row in set (0.01 sec)




标签:
上一篇:MySQL DATEDIFF() Function 下一篇:PHP Ajax 跨域问题最佳解决方案

相关推荐