Dede time lattice test, Dede time tag

Source: Internet
Author: User

Dede's date and time format [field: pubdate function = 'strftime ("time", @ me '/] This is a fixed format (use the strftime () function to format the time ), because you only need to replace the time with the corresponding time format, you can refer to the following

Time Format corresponding to letters

    1. Dede common time format and time call Tag

[Field: pubdate function = 'strftime ("% Y-% m-% d % H: % m: % s", @ me) '/]

12:11:52

[Field: pubdate function = 'strftime ("% Y-% m-% d % H: % m: % s", @ me) '/]

12:11:52-12-11

    • Month and current time

[Field: pubdate function = 'strftime ("% m-% d % H: % m: % s", @ me) '/]

10-01 11:14:20

[Field: pubdate function = 'strftime ("% m-% d % H: % m", @ me) '/]

10-01

    • Current year month day

[Field: pubdate function = 'strftime ("" Y-% m-% d ", @ me) '/]

13-12-01

[Field: pubdate function = 'strftime ("% Y % m % d", @ me) '/]

March December 01

[Field: pubdate function = 'strftime ("% Y % m month % d % H point % m minute % s second", @ me) '/]

December 01, 2013

[Field: pubdate function = 'strftime ("% B % d, % Y", @ me) '/]

Nov 01,201 3

    • Time zone and current time, which can be modified according to the lowest time format

[Field: pubdate function = 'strftime ("% A on % B % d, % Y, % x: % Z", @ me) '/]

Saturday on Nov 01,201 3, 12:21:06: Chinese Standard Time

    1. The color of the time when dede24 published the article

The time displayed within 24 hours after the Dede article is published is red: The base # ff0000 is the time color and can be changed to other colors, for example, # ffffff is white, #000000 is black, # ff0000 is red, #00ff00 is green, # 0000ff is blue, you only need to replace it directly.

[Field: pubdate runphp = 'yes']

$ A = "<font color = '# ff0000'>"; $ B = "</font> ";

$ C = strftime ("% Y % m month % d % H: % m: % s", "@ me ");

$ Ntime = Time ();

$ Oneday = 24x3600;

If ($ ntime-@ me) <$ oneday) @ me = $ A. $ C. $ B;

Else @ me = $ C;

[/Field: pubdate]

    1. Last Update Time of Dede article

{Dede: tagname runphp = 'yes'} @ me = date ("Y-m-d h: I: s ", 
Time (); {/Dede: tagname}

XX days ago

[Field: pubdate runphp = 'yes']

$ Today = floor (Time ()/(3600*24 ));

$ Senday = floor (@ me/(3600*24 ));

    1. Strftime () function formatting time

The abbreviation of astar period.

The full name of the astar period.

The abbreviation of month B.

The full name of month B.

The date and time of the local end of CIS better than that of the string.

D. Use a number to represent the day of the month (range: 00 to 31 ).

H indicates the hour in the 24-hour format (ranging from 00 to 23 ).

I is represented by a 12-hour number (ranging from 01 to 12 ).

J indicates the day of the year in numbers (range: 001 to 366 ).

The number of the month (ranging from 1 to 12 ).

M minutes.

P uses 'am' or 'pm 'to indicate the local time.

S.

The U number indicates the week of the current year. The first week starts from the first Sunday.

The number W indicates the week of the current year. The first week starts from the first Monday.

W indicates the day of the week by number (0 indicates Sunday ).

X does not include the date representation of time.

X does not include the time representation of the date.

Y two digits indicate the year (range: 00 to 99 ).

Y indicates the complete year number, that is, four digits.

Z time zone or abbreviation.

You can modify the time format by directly modifying the corresponding letter above. Note the case sensitivity of the letter.

Dede time lattice test, Dede time tag

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.