Many friends will encounter this problem: in Phpcms V9 in the first page or the article content page call publish time {date (' y-m-d ', $r [inputtime])} Call display 1970-01-01, and then try to use truncation method also did not succeed, should do?
Some friends suggest "first convert to time format, intercept it", the specific code is "{str_cut ($inputtime, $dot =")} ", and some people say" {$updatetime} directly with this call is good ", but many friends still did not succeed!
Let me specify the actual reason for the downgrade to be unsuccessful, and how to solve it!
First, perhaps you are not properly called for the reason:
The code for the general invocation is this:
- There is no reason to call correctly!
- If you use {loop $data $k $v} call, then use {date (' y-m-d h:i:s ', $v [Inputtime])} to apply "V" to the application;
- If you use
- {Loop $data $r}, use {date (' y-m-d h:i:s ', $r [Inputtime])} to apply the "R" call.
- This is called on the list page, and if it is on the article page, it is also possible to use {$inputtime} directly.
This is my previous reply in the Forum, that is, you may have mixed in the middle of V and R.
Second, if there is no mixing, then it can be said to be a V9 problem, because I based on experience, sometimes did not modify the model, but also the call is unsuccessful.
If this is the case, try {$updatetime} or {str_cut ($inputtime, a, $dot = ')} The code is generally not successful.
Then you can try my own measurement out of the solution, before the Forum in reply to have said, this time to collate, and share with you:
1, modify the need to call this time model, backstage "content" on the left side of the "Management model" field management, find 17 "Publish Time" this item, and then click "Modify".
2, in "Time format" inside select "Integer display format"
In addition to the "As basic information" selected, that is, when publishing the article, this item is visible!
Phpcms V9 {date (' y-m-d ', $r [inputtime])} Problem resolution