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('Y-m-d'); ?>
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('Y年m月d日'); ?>
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!