Home > CMS Tutorial > DEDECMS > 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'

藏色散人
Release: 2020-01-15 10:44:12
Original
2941 people have browsed it

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

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(&#39;m-d&#39;,@me); 
[/field:senddate]  
[field:senddate function=MyDate(&#39;H:s&#39;,@me)/]
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template