date_parse_from_format

It returns details  about given date formatted according to the specified format.

Example

<?php
echo “<pre>”;
$date = “20.4.2008”;
print_r(date_parse_from_format(“j.n.Y H:iP”, $date));
?>

Output

Array
(
[year] => 2008
[month] => 4
[day] => 20
[hour] =>
[minute] =>
[second] =>
[fraction] =>
[warning_count] => 0
[warnings] => Array
(
)

[error_count] => 1
[errors] => Array
(
[9] => Data missing
)

[is_localtime] =>
)