Home  >  Article  >  CMS Tutorial  >  How to change the time tag in DreamWeaver to "today, tomorrow, and the day after tomorrow"

How to change the time tag in DreamWeaver to "today, tomorrow, and the day after tomorrow"

藏色散人
藏色散人Original
2020-01-09 09:09:512764browse

How to change the time tag in DreamWeaver to

How to change the time tag to "today, tomorrow, and the day after tomorrow"?

Dreamweaver DEDECMS changes the time tag to "today, tomorrow, the day after tomorrow"

Recommended study:梦weavercms

[field:senddate runphp='yes']  
$ntime = time(); 
$oneday = 3600 * 24; 
$twoday = 3600 * 48; 
$threeday = 3600 * 72; 
if(($ntime - @me) < $oneday) @me = "今天"; 
elseif(($ntime - @me) < $twoday) @me = "昨天"; 
elseif(($ntime - @me) < $threeday) @me = "前天"; 
else 
@me=MyDate('m-d',@me); 
[/field:senddate]  
[field:senddate function=MyDate('H:s',@me)/]

above A period is the implementation date. If it is today, today will be displayed. Yesterday will be displayed yesterday. With the following period label, the effect of "Today 11:41" can be achieved. When the article is not published within three days Just display the time and date, like this "05-24 11:41". The same applies to the pubdate field.

The above is the detailed content of How to change the time tag in DreamWeaver to "today, tomorrow, and the day after tomorrow". For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn