简体   繁体   中英

How can I parse json date in tpl files?

My jSon date format:

release_date: "1426153440",

When I use like this, its done but has a format problem:

{$info.release_date}

Generate to:

1426153440

How can I solve format problem in tpl files? Thank you.

You can use date_format , with it you can combine the conversion specifiers available in strftime() .

Example:

{$info.release_date|date_format:"%Y-%m-%d"}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM