Dedecms call date formatting format Daquan, dedecms date format_php tutorial

Source: Internet
Author: User
Tags month name
Dedecms call date formatting format Daquan, dedecms date format. Dedecms call date formatting forms Daquan, dedecms date format before I learned dedecms, for the date of calling the article also gave me a headache for a long time, edit today to collect the complete dedecms call date formatting format, dedecms date format

I remember that when I first learned dedecms, I had a headache for a long time when I called the article. today I edited a specially collected article about dedecms date formatting, hope to help you

The commonly used date formatting function MyDate () exclusive to dedecms ()

Code: [field: pubdate function = "MyDate ('Y-m-D', @ me)"/] Style: 2013-08-07
Code: [field: pubdate function = "MyDate ('M-D', @ me)"/] Style: 08-07
Code: [field: pubdate function = "MyDate ('Y-m-d H: I: S', @ me)"/] Style: 09:14:38

The above three date formats are often used when we create websites. if you want to set a more personalized date, you can continue to look down.

Dedecms uses the php built-in date formatting function strftime ()

Code: [field: pubdate runphp = 'yes'] @ me = str_replace ('-', '', strftime (" % Y-% m-% d % H: % M: % S ", @ me); [/field: pubdate] Style: August 07, 2013 09:14:38

Note: The above code is called in the arclist on the homepage list page. if you call the content, switch to the following code:

{Dede: field. pubdate function = "MyDate ('Y-m-D', @ me )"/}

In addition, in most online tutorials, [field: pubdate function = 'strftime ("% Y % m month % dday % H point % M minute % S second", @ me) '/], can call August 07, 2013... the format of the date, but a Niu tried it, except that the first % Y will be parsed after all for normal string processing, and % S followed by Chinese, it will not be displayed directly, A friend who wants to know can tell Daniel Q27856361,

The English letters after the percent sign (%) are as follows (tips: WWW. QMTX3.COM). you can freely combine your own time format

% A abbreviation of the day of the week

% A full name of the day of the week

Abbreviation of % B month

% B full name

% C standard date time string

The last two digits of the year % C

% D indicates the day of the month in decimal format.

% D month/day/year

% E indicates the day of the month in decimal format in the two-character Field

% F-Month-Day

The last two digits of the year % g. The year is based on the week.

% G year, based on the week year

% H abbreviated month name

% H in 24-hour format

% I 12-hour

% J indicates the day of the year in decimal format.

Month in % m decimal format

% M decimal number of minutes

% N New Line operator

% P equivalent display of local AM or PM

% R 12 hours

% R display hour and minute: hh: mm

% S decimal seconds

% T horizontal tab

% T display time in seconds: hh: mm: ss

% U the day of the week, Monday is the first day (value ranges from 0 to 6, Monday is 0)

% U indicates the week of the year. Sunday is regarded as the first day (the value ranges from 0 to 53)

% V indicates the week of the year, which is based on the year of the week.

% W decimal indicates the day of the week (the value ranges from 0 to 6, and Sunday is 0)

% W indicates the week of the year. Monday is the first day (from 0 to 53)

% X standard date string

% X standard time string

% Y does not contain the century's decimal year (the value ranges from 0 to 99)

% Y indicates the tenth year of the century.

% Z, % Z time zone name. if the time zone name cannot be obtained, an empty character is returned.

In fact, the above time format is rarely used. I have used dedecms for at least a few years, and it has always been or 08-07, this is also the most common form of dedecms date formatting.


Dedecms time label Call Format

According to the description, you cannot see what you want. 19: May in the figure, that is, H: M in the tag. According to the dede label description, the detailed description is help.dedecms.com/v53/

Why is the date not changed due to dedecms call time?

Pubdate is the time when the article is published. of course it will not change.
 

When I first learned dedecms, I had a headache for calling the article for a long time. today, I edited a special collection...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.