Number 24th began to learn thinkphp, today can not wait to practice the hand, but for thinkphp or a smattering of me, the start is more difficult, the unit inside just came to a corporate website, take thinkphp to practicing it, today take thinkphp do a corporate site, In the output time, but output the PHP timestamp, that is, a string of numbers, is obviously to be the time format, in PHP as long as a class can be, but a thinkphp template inside do not know how to output, had to query the Thinkphp official website, the original is the output label , change the time label to normal output time.
Scenario One (Action Controller):
As formatted in native PHP code, use the DATE function:
$time = Date ("y-m-d", $time)
Scenario two (template):
{$time |date= ' y-m-d ', ###}
As shown below:
{$wz [' add_time ']|date= ' y-m-d ', ###}
{$wz [' Add_time ']} has a value of 1372468992 and the time shown is 2013-01-24
The correct value is: 2013-06-29