伍佰目录 短网址
  当前位置:海洋目录网 » 站长资讯 » 站长资讯 » 文章详细 订阅RssFeed

PHP - Manual: Compound Formats

来源:网络转载 浏览:62次 时间:2022-11-17
Relative Formats » « Date Formats PHP 手册 函数参考 日期与时间相关扩展 日期/时间 Supported Date and Time Formats

Compound Formats

This page describes the different compound date/time formats that the DateTimeImmutable, DateTime, date_create(), date_create_immutable(), and strtotime() parser understands.

Used Symbols Description Formats Examples DD "0" [0-9] | [1-2][0-9] | "3" [01] "02", "12", "31" doy "00"[1-9] | "0"[1-9][0-9] | [1-2][0-9][0-9] | "3"[0-5][0-9] | "36"[0-6] "001", "012", "180", "350", "366" frac . [0-9]+ ".21342", ".85" hh "0"?[1-9] | "1"[0-2] "04", "7", "12" HH [01][0-9] | "2"[0-4] "04", "07", "19" meridian [AaPp] .? [Mm] .? [\0\t ] "A.m.", "pM", "am." ii [0-5]?[0-9] "04", "8", "59" II [0-5][0-9] "04", "08", "59" M 'jan' | 'feb' | 'mar' | 'apr' | 'may' | 'jun' | 'jul' | 'aug' | 'sep' | 'sept' | 'oct' | 'nov' | 'dec'   MM [0-1][0-9] "00", "12" space [ \t]   ss ([0-5]?[0-9])|60 "04", "8", "59", "60" (leap second) SS [0-5][0-9] "04", "08", "59" W "0"[1-9] | [1-4][0-9] | "5"[0-3] "05", "17", "53" tzcorrection "GMT"? [+-] hh ":"? II? "+0400", "GMT-07:00", "-07:00" YY [0-9]{4} "2000", "2008", "1978" Standards Formats Description Examples ATOM "2022-06-02T16:58:35+00:00" COOKIE "Thursday, 02-Jun-2022 16:58:35 UTC" ISO8601 "2022-06-02T16:58:35+0000" » RFC 822 "Thu, 02 Jun 22 16:58:35 +0000" » RFC 850 "Thursday, 02-Jun-22 16:58:35 UTC" » RFC 1036 "Thu, 02 Jun 22 16:58:35 +0000" » RFC 1123 "Thu, 02 Jun 2022 16:58:35 +0000" » RFC 2822 "Thu, 02 Jun 2022 16:58:35 +0000" » RFC 3339 "2022-06-02T16:58:35+00:00" » RFC 3339 Extended "2022-06-02T16:58:35.698+00:00" » RFC 7231 "Thu, 02 Jun 2022 16:58:35 GMT" RSS "Thu, 02 Jun 2022 16:58:35 +0000" W3C "2022-06-02T16:58:35+00:00" Localized Notations Description Format Examples Common Log Format dd "/" M "/" YY : HH ":" II ":" SS space tzcorrection "10/Oct/2000:13:55:36 -0700" EXIF YY ":" MM ":" DD " " HH ":" II ":" SS "2008:08:07 18:11:31" ISO year with ISO week YY "-"? "W" W "2008W27", "2008-W28" ISO year with ISO week and day YY "-"? "W" W "-"? [0-7] "2008W273", "2008-W28-3" MySQL YY "-" MM "-" DD " " HH ":" II ":" SS "2008-08-07 18:11:31" PostgreSQL: Year with day-of-year YY "."? doy "2008.197", "2008197" SOAP YY "-" MM "-" DD "T" HH ":" II ":" SS frac tzcorrection? "2008-07-01T22:35:17.02", "2008-07-01T22:35:17.03+08:00" Unix Timestamp "@" "-"? [0-9]+ "@1215282385" XMLRPC YY MM DD "T" hh ":" II ":" SS "20080701T22:38:07", "20080701T9:38:07" XMLRPC (Compact) YY MM DD 't' hh II SS "20080701t223807", "20080701T093807" WDDX YY "-" mm "-" dd "T" hh ":" ii ":" ss "2008-7-1T9:3:37"

注意:

The "W" in the "ISO year with ISO week" and "ISO year with ISO week and day" formats is case-sensitive, you can only use the upper case "W".

The "T" in the SOAP, XMRPC and WDDX formats is case-sensitive, you can only use the upper case "T".

The "Unix Timestamp" format sets the timezone to UTC.

add a note

User Contributed Notes 2 notes

up down 2 Bilge at steam250 dot com1 year ago Unix timestamps also accept a microseconds specifier. e.g. @1607974647.503686 is valid and will be parsed as 2020-12-14 19:37:27.503686+00. up down -3 tuxedobob6 years ago When trying to create a DateTime from a string, PHP essentially doesn't care about leading zeroes in hours.

When converting a DateTime to a string, PHP will honor leading zeroes as documented in date().
add a note

官方地址:https://www.php.net/manual/en/datetime.formats.compound.php

  推荐站点

  • At-lib分类目录At-lib分类目录

    At-lib网站分类目录汇集全国所有高质量网站,是中国权威的中文网站分类目录,给站长提供免费网址目录提交收录和推荐最新最全的优秀网站大全是名站导航之家

    www.at-lib.cn
  • 中国链接目录中国链接目录

    中国链接目录简称链接目录,是收录优秀网站和淘宝网店的网站分类目录,为您提供优质的网址导航服务,也是网店进行收录推广,站长免费推广网站、加快百度收录、增加友情链接和网站外链的平台。

    www.cnlink.org
  • 35目录网35目录网

    35目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向35目录推荐、提交优秀网站。

    www.35mulu.com
  • 就要爱网站目录就要爱网站目录

    就要爱网站目录,按主题和类别列出网站。所有提交的网站都经过人工审查,确保质量和无垃圾邮件的结果。

    www.912219.com
  • 伍佰目录伍佰目录

    伍佰网站目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向伍佰目录推荐、提交优秀网站。

    www.wbwb.net