|
|
PHP date_parse_from_format() Function
|
Tutorials » Php »
|
Topic |
What is a Date Parse From Format Function?
|
|
Explanation |
|
The "date_parse_from_format()" function is used get the detailed information for a given date.
Syntax:
array date_parse_from_format (string $format, string $date)
In the above syntax "format" is the required output format, "date" is the date for which detailed information is needed.
Example:
<?php
$date = "6.1.2009 13:00+01:00";
print_r(date_parse_from_format("j.n.Y H:iP", $date));
?>
Result:
Array
(
[year] => 2009
[month] => 1
[day] => 6
[hour] => 13
[minute] => 0
[second] => 0
[fraction] =>
[warning_count] => 0
[warnings] => Array
(
)
[error_count] => 0
[errors] => Array
(
)
[is_localtime] => 1
[zone_type] => 1
[zone] => -60
[is_dst] =>
)
In the above example the date_parse_from_format() function will display all the details, for the specified date "6.1.2009" in a detailed format.
Note: (PHP 5 >= 5.3.0)
|
|
A Note |
Learn PHP programming language tutorial with simple and neat example. Hope you enjoy this free tutorial.
Do give us your valuable feedback and suggestions on this online tutorial. This is a Copyright Content.
|
|
|
|