How to use PHP date_parse function

Source: Internet
Author: User


The Date_parse () function returns an associative array that contains details for the specified day. If successful, returns an associative array containing the resolved date information, or FALSE if it fails. The parameters that can be resolved are the same as those supported by Strtotime ().

Definitions and usage

The Date_parse () function returns an associative array that contains details for the specified day.

Grammar

Date_parse (date);

Parameter description
Date Required. The specified date (format is accepted by Strtotime ()).
Technical details
Return value: Returns an associative array containing the resolved date information if successful and FALSE if it fails.
PHP version: 5.2+

<?php
Print_r (Date_parse ("2016/1/11 10:05:50"));
?>

Output:

Array
(
[Year] => 2016
[Month] => 1
[Day] => 11
[Hour] => 10
[Minute] => 5
[Second] => 50
[Fraction] => 0
[Warning_count] => 0
[Warnings] => Array
(
)

[Error_count] => 0
[Errors] => Array
(
)

[Is_localtime] =>
)

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.