开发者

Convert unix timestamp [duplicate]

开发者 https://www.devze.com 2023-03-09 13:11 出处:网络
This question already has answers here: Closed 11 years ago. 开发者_StackOverflow中文版 Possible Duplicate:
This question already has answers here: Closed 11 years ago. 开发者_StackOverflow中文版

Possible Duplicate:

How to convert Unix timestamp to hhmmss?

Here is unix timestamp of today

1306702800

How to convert it to look like 30-05-2011 using php ?


You can use the date function to convert (and arbitrarily re-format) timestamps as such:

echo date('d-m-Y', 1306702800);

Additionally, you can get the current timestamp via the time function, so you could output the current date via: echo date('d-m-Y', time());.


Use PHP's date functions: http://nl3.php.net/manual/en/function.date.php


See date

echo date('d-m-Y', '%your-time-stamp%');
0

精彩评论

暂无评论...
验证码 换一张
取 消