The “time WordPress” date and time call function

Time:2020-1-15

Copy code

The code is as follows:

<?php the_time(‘Y-m-d’); ?>

It shows 2011-10-1. You can change the contents of () with the following characters to achieve the corresponding effect.

Copy code

The code is as follows:

< PHP the time (‘m / D / y ‘);? >

On October 1, 2011

A stands for the first afternoon of lowercase English, such as am, PM
A stands for the first afternoon of capital English, such as am, PM
D stands for the date in English (less than 10 is still in double digits), such as 05, 12
D stands for Chinese week, such as Friday and July
F stands for the month in Chinese (including the word “month”), such as may and December
G represents English hours (less than 10 is one digit writing), such as 5, 12
G stands for English hours (less than 10 is still two digit writing), such as 05, 12
H represents English minutes (less than 10 is one digit writing), such as 5, 12
H stands for English minutes (less than 10 is still two digit writing), such as 05, 12
J represents the date in English (less than 10 is one digit writing), such as 05, 12
L stands for Chinese week (including “week”), such as Friday and Sunday
M stands for the month in English (it is still written in double digits if it is less than 10), such as 05 and 12
M stands for the month in English (in words), such as Jun
N represents the month in English (less than 10 is one digit writing), such as 5, 12
O represents the time zone of English, such as + 0800
R for complete date time, such as Tue, 06 Jun 2006 18:37:11 + 0800
S is the ordinal suffix of the date, such as St, th
T represents the time zone in English (displayed in words), such as CST
W stands for English week, such as 5, 7
W is the number of weeks, such as 23
Y represents a two digit year, such as 07, 08
Y represents a four digit year, such as 2007, 2008
Z for days, such as 156

Recommended Today

[Redis5 source code learning] analysis of the randomkey part of redis command

baiyan Command syntax Command meaning: randomly return a key from the currently selected databaseCommand format: RANDOMKEY Command actual combat: 127.0.0.1:6379> keys * 1) “kkk” 2) “key1” 127.0.0.1:6379> randomkey “key1” 127.0.0.1:6379> randomkey “kkk” Return value: random key; nil if database is empty Source code analysis Main process The processing function corresponding to the keys command is […]