Home > CMS Tutorial > DEDECMS > body text

What are the DEDE date and time formats?

藏色散人
Release: 2019-11-16 10:08:57
Original
3245 people have browsed it

What are the DEDE date and time formats?

DEDE日期时间格式有哪些?

DEDE日期时间格式大全

日期时间格式 (利用strftime()函数格式化时间)

首页:

([field:pubdate function='strftime("%m-%d",@me)'/])==(5-15) 
([field:pubdate function='strftime("%b %d, %Y",@me)'/])==(May 15, 2008)
Copy after login

列表页:

[field:pubdate function="GetDateTimeMK(@me)"/]==2008-1-1 18:30:02 
[field:pubdate function="GetDateMK(@me)"/]==2008-05-15
Copy after login

内容页:

{dede:field name='pubdate' function='GetDateMk(@me)'/}==2008-05-15 
{dede:field name='pubdate' function='strftime("%b %d, %Y",@me)'/}==May 15, 2008
Copy after login

推荐学习:dedecms教程

利用strftime()函数将时间格式化:

%a 星期几的简写

%A 星期几的全称

%b 月份的简写

%B 月份的全称

%c 标准的日期的时间串

%C 年份的后两位数字

%d 十进制表示的每月的第几天

%D 月/天/年

%e 在两字符域中,十进制表示的每月的第几天

%F 年-月-日

%g 年份的后两位数字,使用基于周的年

%G 年分,使用基于周的年

%h 简写的月份名

%H 24小时制的小时

%I 12小时制的小时

%j 十进制表示的每年的第几天

%m 十进制表示的月份

%M 十时制表示的分钟数

%n 新行符

%p 本地的AM或PM的等价显示

%r 12小时的时间

%R 显示小时和分钟:hh:mm

%S 十进制的秒数

%t 水平制表符

%T 显示时分秒:hh:mm:ss

%u 每周的第几天,星期一为第一天 (值从0到6,星期一为0)

%U 第年的第几周,把星期日做为第一天(值从0到53)

%V 每年的第几周,使用基于周的年

%w 十进制表示的星期几(值从0到6,星期天为0)

%W 每年的第几周,把星期一做为第一天(值从0到53)

%x 标准的日期串

%X 标准的时间串

%y 不带世纪的十进制年份(值从0到99)

%Y 带世纪部分的十制年份

%z,%Z 时区名称,如果不能得到时区名称则返回空字符。

The above is the detailed content of What are the DEDE date and time formats?. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!