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%');
精彩评论