Weaving Dream dedecms Article release date time call label Daquan

Source: Internet
Author: User
Tags month name

DEDECMS Home Time Label:

1, 12-27 style

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

2, May 15, 2012 style

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

DEDECMS List page Time label:

1, 2012-08-20 18:30:02 style:

[Field:pubdate function= "Getdatetimemk (@me)"/]

2.2012-08-20 Style:

[Field:pubdate function= "Getdatemk (@me)"/]

3. All other formats:

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

08th [Field:pubdate function=strftime ('%d day ', @me)/]

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

June 08 [field:pubdate Function=strftime ('%m month%d ', @me)/]

09-06-08 [Field:pubdate function=strftime ('%y-%m-%d ', @me)/]

2009-06-08 [Field:pubdate function=strftime ('%y-%m-%d ', @me)/]

June 08, 09 [field:pubdate function=strftime ('%y%m month%d day ', @me)/]

June 08, 2009 [field:pubdate function=strftime ('%y%m month%d day ', @me)/]

2009-06-08 13:28 [field:pubdate function=strftime ('%y-%m-%d%h:%m ', @me)/]

4. There are three main types of function usages for dedecms call times:

[Field:pubdate function= "Getdatemk (@me)"/]

[Field:pubdate function=mydate (' y-m-d ', @me)/]

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

These three kinds of time formats displayed in the foreground are the "2012-12-25" format, and you can call them flexibly.

DEDECMS content page Time label:

1.2012-08-20 Style:

{Dede:field name= ' pubdate ' function= ' Getdatemk (@me) '/}

2, May 15, 2012 style:

{Dede:field name= ' pubdate ' function= ' strftime ("%b%d,%Y", @me) '/}

The time in 24 hours is displayed in red:

[Field:pubdate runphp= ' yes ']

$a = ";";

$b = "

$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]

Last update Time:

{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));

$updays = $today-$senday;

if ($updays ==0) @me = "Today";

else @me = $updays. " Days ago ";

[/field:pubdate]

Use the strftime () function to format the time:

%a shorthand for the day of the week

%A full name of the week

%b of the Month

Full name of the%B month

Time string for the date of%c standard

After two digits of the%c year

The day ordinal of a month in%d decimal notation

%d Month/day/year

%e the day ordinal of a month in a two-character field, in decimal notation

%F year-month-day

%g two digits of the year, using week-based

%G years, using week-based years

%h Abbreviated month name

%H 24-Hour Hour

%I 12-Hour Hour

%j decimal indicates the day ordinal of the year

%m the month represented by decimal

%M minutes in a 10 o'clock-hour representation

%n New Line character

%p equivalent display of the local AM or PM

%r 12 hours of time

%R display hours and minutes: hh:mm

%s number of seconds in decimal

%t Horizontal Tab

%T display time seconds: hh:mm:ss

%u days of the week, Monday for the first day (values from 0 to 6, Monday to 0)

%u year of the week, the Sunday as the first day (value from 0 to 53)

%V Week of the year, using week-based

%w Decimal Day of the week (value from 0 to 6, Sunday is 0)

%W Week of the year, Monday as the first day (value from 0 to 53)

Date string for%x standard

Time string for%x standard

%y decimal Year without century (values from 0 to 99)

%Y 10 year with century part

%z,%z the time zone name and returns a null character if the time zone name cannot be obtained.

Weaving Dream dedecms Article release date time call label Daquan

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.