WordPress Time Date Function Common code

Source: Internet
Author: User
Tags wordpress setup

In the process of modification, we will inevitably use the time function, which of course involves the time format of WordPress. Then we just have to make some corresponding changes to the time function: The_time (), we can achieve the effect we want, first I have to know the meaning of those parameters, so it will be handy. First look at the following table:

Parameters

Parameter description

Output Time format

D

Date

06

J

Date

6

D

Week

One

F

Month

January

G

Hours

6

G

Hours

06

H

Minutes

6

H

Minutes

06

A

Last afternoon

am/pm

A

Last afternoon

am/pm

L

Week

Monday

M

Month

01

M

Month

Jan

N

Month

6

O

Time

+0800

R

Full Date and time

Mon, Jan 2010 20:30:10 +0800

S

The suffix of a sequence type number

St/th

T

Time

Cst

W

Week

2

W

Week number

22

Y

Year

10

Y

Year

2010

Z

Days

365

Here are some examples of WordPress setup time format:

Chinese date format setting, Month Date: For example: February 1, 2010, then the parameters of the time function of WordPress write:

The setting of the Chinese time, hours and seconds: For example: 22:22:22, then the parameters of the WordPress times function write:

Week format set, week: For example: Thursday, November 1, 2010, the parameters of the time function for WordPress are written like this:

Of course, sometimes our theme like the Chinese and English mixed lost date display format, for the use of English version of WordPress, this will do some small adjustments. Here, for example, the month in which the log time is displayed, we use the The_time (' M ') in the subject to print out the month value of a Sep abbreviation. But fortunately and unfortunately, WordPress will be very human for you to translate into "Nine", said Lucky, is because of the intelligent WordPress people feel happy, said unfortunately because I really do need Sep such English shorthand time format, this let me how to be good.

So what do we do at this time, from a functional point of view to solve this problem, reset, to avoid the Chinese.

To add a function:

Replace with:

Echo Date

This is when we find the time format we need.

WordPress Time Date Function Common code

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.