PHPDateFunctionBase, datebase_PHP tutorial

Source: Internet
Author: User
PHPDateFunctionBase, datebase. PHPDateFunctionBase, in datebase ************************** aam, pmAAM, or PMd days, two digits. if there are less than two digits, the preceding PHP Date Function Base, datebase
**************/
A-"am" or "pm" A-"AM" or "PM" d-days, two digits. if there are less than two digits, the first digit is set to zero. for example: "01" to "31" D-Day of the week, three English letters; for example, "Fri" F-month, full English name; for example: "January" h-12 hours; for example, "01" to "12" H-24 hours; for example: "00" to "23" g-12 hours, less than two do not fill zero; for example: "1" to 12 "G-24 hours, for example, "0" to "23" I-minutes; for example, "00" to "59" j-days, two digits. if the remaining two digits are not zero; for example: "1" to "31" l-day of the week, full English name; for example: "Friday" L-get leap year return 1 else return 0 m-month, two digits, if there are less than two digits, then add zero. for example, "01" to "12" n-month, two digits. if there are less than two digits, do not add zero. for example: "1" to "12" M-month, three English letters; for example: "Jan" s-seconds; for example: "00" to "59" S-ending with an English ordinal number, two English letters; for example: "th", "nd" t-specifies the number of days of the month; for example: "28" to "31" U-total number of seconds w-number type day of the week, for example: "0" (Sunday) to "6" (Saturday) Y-year, four digits, for example, "1999" y-year, two digits, for example, "99" z-the day of the year; for example, "0" to "365" 1. date (char_date, unix );Current date: AMecho date ('Y-m-d H: I a'); ---> output: 2015-4-7 AMecho date ('Y-m-d h: I a'); ---> output: AM Not Chang (1) date_default_timezone_set ('prc'); PHP 5.1 + (2) PHP. ini Update date. tiemzone = PRC echo date ('Y-m-d h: I a'); ---> output: AM Changed 2. strtotime (char_date [, int $ now]);The date string conversion unix echo strtotime ('2017-4-7 '); ---> output: 2015 timestampecho date ('Y-m-D', strtotime ('2017-4-7 '); ---> output: 2015-04-06echo date ('Y-m-D', strtotime ("+ 3 day"); ---> output: 2015-04-10echo date ('Y-m-D ', strtotime ("next year"); ---> output: 2016-04-10 3. gmdate (char_date_mode, unix );The unix conversion date string echo gmdate ("Y-m-d", 1428336000); ---> output: 2015-04-06 4. mktime (h, I, s, m = "m", d = "d", y = "y ");Based on date return unixecho gmdate ("Y-m-d H: I: s A", mktime (0, 0, 0, "8", "18 ", "2018"); ---> output: 16:00:00 5. checkdate (m, d, y );Checking data time
Echo checkdate (2016 )? "True": "False"; ---> output: Falseecho checkdate (2016 )? "True": "False"; ---> output: True 6. getdate (unix)Return date array print_r (getdate (time ()); array ([seconds] => 37 [minutes] => 10 [hours] => 16 [mday] => 7 [wday] => 2 [mon] => 4 [year] => 2015 [yday] => 96 [weekday] => Tuesday [month] => limit L [0] => 1428394237)

The http://www.bkjia.com/PHPjc/980032.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/980032.htmlTechArticlePHP Date Function Base, in datebase/*************************/a "am "pm" A "AM" or "PM" d days, two digits. if there are less than two digits, the first digit is...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.