dedecms 时间标签strftime和MyDate

时间:2023-03-10 06:59:12
dedecms   时间标签strftime和MyDate
 先说下内容页样式:

日期:{field:pubdate function=strftime('m-d',@me)/} 01-01

日期:{field:pubdate function=strftime('m月d日',@me)/} 01月01日

日期:{field:pubdate function=strftime('d日',@me)/} 01日

日期:{field:pubdate function=strftime('Y-m-d',@me)/} 2012-01-01

日期:{field:pubdate function=strftime('y-m-d',@me)/} 12-01-01

日期:[field:pubdate function='strftime("%Y-%m-%d %H:%M:%S",@me)'/]  2008-11-01 11:11:52

日期:[field:pubdate function='strftime("%y-%m-%d %H:%M:%S",@me)'/]   08-11-01 11:11:52

日期:[field:pubdate function='strftime("%b %d, %Y",@me)'/]    Nov 01, 2008

日期:[field:pubdate function='strftime("%A on %b %d, %Y, %X : %Z",@me)'/]   Saturday on Nov 01, 2008, 11:21:06 : 中国标准时间

那列表页和主页的样式就需要转换一下了!修改成如下:

日期:[field:pubdate function="MyDate('m-d',@me)"/] 01-01

日期:[field:pubdate function="MyDate('m月d日',@me)"/]  01月01日

日期:[field:pubdate function="MyDate('d日',@me)"/] 01日

日期:[field:pubdate function="MyDate('Y-m-d',@me)"/] 2012-01-01

日期:[field:pubdate function="MyDate('y-m-d',@me)"/] 12-01-01

下面 举一个例子:

<span class="date">[field:pubdate function="MyDate('d',@me)"/]<u>[field:pubdate function='strftime("%b",@me)'/]</u></span>

效果如图所示:dedecms   时间标签strftime和MyDate

dedecms   时间标签strftime和MyDate