date_parse in PHP

Syntax of date_parse in PHP

array date_parse(string time)

Converts an English description of a time and date into an array describing that time and date. Returns false if the value could not be converted into a valid date. The returned array contains the same values as returned from date_parse_from_format().

Example of date_parse

<?php
print_r(date_parse("2006-12-12 10:00:00.5"));
?>
Array
(
    [year] => 2006
    [month] => 12
    [day] => 12
    [hour] => 10
    [minute] => 0
    [second] => 0
    [fraction] => 0.5
    [warning_count] => 0
    [warnings] => Array()
    [error_count] => 0
    [errors] => Array()
    [is_localtime] => 
)

Leave a Comment