Time Format Basics
{Dede:field name= ' pubdate ' function= ' strftime ("%y year%M month%d day%h:%m:%s", "@me") '/}2007 year January 1 18:30:02
{Dede:field name= ' pubdate ' function= ' strftime ("%y-%m-%d%h:%m:%s", "@me") '/}2007-1-1 18:30:02
{Dede:field name= ' pubdate ' function= ' strftime (%y year%m month%d%h%m minute%s seconds, "@me") '/}2007 January 1 18:30 02 sec
{Dede:field name= ' pubdate ' function= ' strftime ("%m-%d%h:%m:%s", "@me") '/}1-1 18:30:02
{Dede:field name= ' pubdate ' function= ' strftime ("%m-%d", "@me") '/}1-1
%y-year
%m-Month
%d-Day
%h-hours
%m-min
%s-sec
2. Give the time of the article published within 24 hours to show red.
[Field:pubdate runphp= ' yes ']
$a = "<font color= ' #ff0000 ' >";
$b = "</font>";
$c =strftime ("%y year%M month%d%h:%m:%s", "@me");
$ntime = time ();
$oneday = 3600 * 24;
if ($ntime-@me) < $oneday) @me = $a. $c. $b;
else @me = $c;
[/field:pubdate]
3. Last update time of the article
Last updated: {dede:tagname runphp= ' yes '} @me = Date ("Y-m-d h:i:s", Time ()); {/dede:tagname}
4. If you want to call a few days before the time, to refer to the following time tag code
[Field:pubdate runphp= ' yes ']
$today = Floor (Time ()/(3600 * 24));
$senday = Floor (@me/(3600 * 24));
$updays = $today-$senday;
if ($updays ==0) @me = "Today";
else @me = $updays. " Days ago ";
[/field:pubdate]
Dede Call time