date_parse_from_format

PHP 5 >= 5.3.0, PHP 7, PHP 8
date_parse_from_format - Get info about given date formatted according to the specified format
Manual
Code Examples

date_parse_from_format( string$format, string$datetime ): array

Returns associative array with detailed info about given date/time.

Parameters

format

Format accepted by DateTime::createFromFormat.

datetime

String representing the date/time.

Return Values

Returns associative array with detailed info about given date/time.

Changelog

Version Description
7.2.0 The zone element of the returned array represents seconds instead of minutes now, and its sign is inverted. For instance -120 is now 7200.

Related Functions

Example of date_parse_from_format

Show all examples for date_parse_from_format

PHP Version: