Home  >  Article  >  Backend Development  >  What does I mean in date in php

What does I mean in date in php

藏色散人
藏色散人Original
2021-11-23 10:14:181945browse

I in date in php is the capital form of i, indicating whether the date is in daylight saving time, if it is daylight saving time, it is 1, otherwise it is 0; while the lowercase i means "minute", with a leading Zero 00 to 59.

What does I mean in date in php

#The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.

What does I mean in date in php?

date() function formats the local date and time and returns the formatted date string.

语法:date(format,timestamp);

The meaning of each letter in the PHP date date function

There are some characters with predefined meanings that you can use to create format strings. They are:

format	必需。规定输出日期字符串的格式。
可使用下列字符:

d - 一个月中的第几天(从 01 到 31)
D - 星期几的文本表示(用三个字母表示)
j - 一个月中的第几天,不带前导零(1 到 31)
l('L' 的小写形式)- 星期几的完整的文本表示
N - 星期几的 ISO-8601 数字格式表示(1表示Monday[星期一],7表示Sunday[星期日])
S - 一个月中的第几天的英语序数后缀(2 个字符:st、nd、rd 或 th。与 j 搭配使用)
w - 星期几的数字表示(0 表示 Sunday[星期日],6 表示 Saturday[星期六])
z - 一年中的第几天(从 0 到 365)
W - 用 ISO-8601 数字格式表示一年中的星期数字(每周从 Monday[星期一]开始)
F - 月份的完整的文本表示(January[一月份] 到 December[十二月份])
m - 月份的数字表示(从 01 到 12)
M - 月份的短文本表示(用三个字母表示)
n - 月份的数字表示,不带前导零(1 到 12)
t - 给定月份中包含的天数
L - 是否是闰年(如果是闰年则为 1,否则为 0)
o - ISO-8601 标准下的年份数字
Y - 年份的四位数表示
y - 年份的两位数表示
a - 小写形式表示:am 或 pm
A - 大写形式表示:AM 或 PM
B - Swatch Internet Time(000 到 999)
g - 12 小时制,不带前导零(1 到 12)
G - 24 小时制,不带前导零(0 到 23)
h - 12 小时制,带前导零(01 到 12)
H - 24 小时制,带前导零(00 到 23)
i - 分,带前导零(00 到 59)
s - 秒,带前导零(00 到 59)
u - 微秒(PHP 5.2.2 中新增的)
e - 时区标识符(例如:UTC、GMT、Atlantic/Azores)
I(i 的大写形式)- 日期是否是在夏令时(如果是夏令时则为 1,否则为 0)
O - 格林威治时间(GMT)的差值,单位是小时(实例:+0100)
P - 格林威治时间(GMT)的差值,单位是 hours:minutes(PHP 5.1.3 中新增的)
T - 时区的简写(实例:EST、MDT)
Z - 以秒为单位的时区偏移量。UTC 以西时区的偏移量为负数(-43200 到 50400)
c - ISO-8601 标准的日期(例如 2013-05-05T16:34:42+00:00)
r - RFC 2822 格式的日期(例如 Fri, 12 Apr 2013 12:01:05 +0200)
U - 自 Unix 纪元(January 1 1970 00:00:00 GMT)以来经过的秒数
同时,也可使用下列预定义常量(从 PHP 5.1.0 开始可用):

DATE_ATOM - Atom(例如:2013-04-12T15:52:01+00:00)
DATE_COOKIE - HTTP Cookies(例如:Friday, 12-Apr-13 15:52:01 UTC)
DATE_ISO8601 - ISO-8601(例如:2013-04-12T15:52:01+0000)
DATE_RFC822 - RFC 822(例如:Fri, 12 Apr 13 15:52:01 +0000)
DATE_RFC850 - RFC 850(例如:Friday, 12-Apr-13 15:52:01 UTC)
DATE_RFC1036 - RFC 1036(例如:Fri, 12 Apr 13 15:52:01 +0000)
DATE_RFC1123 - RFC 1123(例如:Fri, 12 Apr 2013 15:52:01 +0000)
DATE_RFC2822 - RFC 2822(Fri, 12 Apr 2013 15:52:01 +0000)
DATE_RFC3339 - 与 DATE_ATOM 相同(从 PHP 5.1.3 开始)
DATE_RSS - RSS(Fri, 12 Aug 2013 15:52:01 +0000)
DATE_W3C - 万维网联盟(例如:2013-04-12T15:52:01+00:00)

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What does I mean in date in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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