Home > CMS Tutorial > WordPress > the_time How to use WordPress date and time calling functions

the_time How to use WordPress date and time calling functions

藏色散人
Release: 2020-01-11 09:49:34
Original
3280 people have browsed it

the_time How to use WordPress date and time calling functions

the_time WordPress date and time call function how to use?

the_time WordPress date and time call function, use wordpress Friends can refer to it.

Recommended: "wordpress tutorial"

The code is as follows:

<?php the_time(&#39;Y-m-d&#39;); ?>
Copy after login

displays 2011-10-1 like this , modify the content in () and replace it with the following characters to achieve the corresponding effect.

The code is as follows:

<?php the_time(&#39;Y年m月d日&#39;); ?>
Copy after login

displays October 1, 2011

a represents the morning and afternoon in lowercase English, such as am, pm

A Represents uppercase English morning and afternoon, such as AM, PM

d represents the English date (less than 10 is still written as a two-digit number), such as 05, 12

D represents the Chinese day of the week, For example, May and July

F represents the Chinese month (including the word "month"), such as May and December

g represents the hour in English (less than 10 is written as a single digit ), such as 5, 12

G represents the English hour (less than 10 is still written as a two-digit number), such as 05, 12

h represents the English minute (less than 10 is a single digit writing method), such as 5, 12

H represents the minute in English (less than 10 is still written as two digits), such as 05, 12

j represents the date in English (less than 10 is one digit Number writing), such as 05, 12

l represents the Chinese week (including the two characters "week"), such as Friday and Saturday

m represents the English month (less than 10 is still written as two digits), such as 05, 12

M represents the English month (displayed in the form of words), such as Jun

n represents the English month (less than 10 is a single digit Writing method), such as 5, 12

O represents the English time zone, such as 0800

r represents the complete date and time, such as Tue, 06 Jun 2006 18:37:11 0800

S represents the ordinal suffix of the date, such as st, th

T represents the English time zone (displayed in the form of a word), such as CST

w represents the English day of the week, such as 5, 7

W represents the week number, such as 23

y represents the two-digit year, such as 07, 08

Y represents the four-digit year, such as 2007, 2008

z represents the number of days, such as 156

The above is the detailed content of the_time How to use WordPress date and time calling functions. 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