Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Which format parameters can be identified by the PHP format string

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

Today, I would like to share with you the relevant knowledge points about which format parameters can be identified by the PHP format string. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.

The format string recognizes the string format character of the following format parameters to describe the day of the returned value example day-d month, the day of the week from 01 to 31D with leading zeros, the text indicates the day of the month from 3 letters Mon to Sunj, and the day of the week without leading zeros to 31l (lowercase letters of "L") Full text format Sunday to SaturdayNISO-8601 format the number of days of the week (PHP 5.1.0 new) 1 (for Monday) to 7 (for Sunday) S the English suffix after the number of days per month, 2 characters st,nd,rd or th. You can use the day ordinal of the w week with j, and the number represents the day ordinal of the year 0 (for Sunday) to 6 (for Saturday) z-the week ordinal of the year in WISO-8601 format, each week beginning on Monday (added by PHP 4.1.0), for example: 42 (week 42 of the year) month-F month, full text format For example, the number of months represented by January or MarchJanuary to Decemberm, the month represented by the three-letter abbreviation Jan to Decn without leading zero to 12m, the number of days required for a given month without leading zero to 12t 28 to 31 years-L is a leap year if it is a leap year, otherwise it is a year number in 0oISO-8601 format. This is the same as the value of Y, except that if the week (W) of ISO belongs to the previous year or the next year, that year is used. (PHP 5.1.0 new) Examples: 1999 or 2003Y4 digits full representation of the year for example: 1999 or 2003y2 digits for example: 99 or 03 time-a morning and afternoon values in lowercase am or pmA uppercase morning and afternoon values AM or PMBSwatch Internet standard hours 000g to 999g hours, 12-hour format, no leading zero to 12G hours, 24-hour format, no leading zero to 23h, 12-hour format Leading 0 01 to 12 H hours, 24 hour format, leading 0 00 to 23 I minutes 00 to 59 > s seconds, leading 0 00 to 59 > u milliseconds (PHP 5.2.2 new). It is important to note that the date () function always returns 000000 because it only accepts the integer parameter, while DateTime::format () supports milliseconds. Example: 654321 time zone-e time zone identification (PHP 5.1.0 new) for example: whether UTC,GMT,Atlantic/AzoresI is daylight saving time if daylight saving time is 1, otherwise it is the number of hours between 0 and GMT, for example: the difference between + 0200p and Greenwich mean time (Greenwich mean time), there is a colon separation between hours and minutes (added by PHP 5.1.3) for example: the time zone in which EST is located. MDT ([translator's Note] is the full text format under Windows, such as "Eastern Standard Time", the Chinese version will display "China Standard time"). The number of seconds for the Z time offset. The time zone offset on the west side of UTC is always negative and the time zone offset on the east side of UTC is always positive. -43200 to 43200 complete date / time-date in cISO 8601 format (newly added by PHP 5) 2004-02-12T15:19:21+00:00rRFC 822format date for example: Thu, 21 Dec 2000 16:01:07 + 0200U the number of seconds since the Unix era (January 1 1970 00:00:00 GMT) see time () above is all the content of the article "which format parameters can be identified by PHP format string". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report