php-extended / php-datetime-parser-object
A library that implements php-extended\php-datetime-parser-interface library
7.0.7
2024-12-08 22:14 UTC
Requires
- php: >=8.0
- php-extended/php-datetime-parser-interface: ^7
- php-extended/php-parser-object: ^7
Requires (Dev)
- dev-master
- 7.0.7
- 7.0.6
- 7.0.5
- 7.0.4
- 7.0.3
- 7.0.2
- 7.0.1
- 7.0.0
- 6.0.8
- 6.0.7
- 6.0.6
- 6.0.5
- 6.0.4
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- 5.0.1
- 5.0.0
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.0.29
- 3.0.28
- 3.0.27
- 3.0.26
- 3.0.25
- 3.0.24
- 3.0.23
- 3.0.22
- 3.0.21
- 3.0.20
- 3.0.19
- 3.0.18
- 3.0.17
- 3.0.16
- 3.0.15
- 3.0.14
- 3.0.13
- 3.0.12
- 3.0.11
- 3.0.10
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
This package is auto-updated.
Last update: 2024-12-08 21:16:40 UTC
README
A library that implements php-extended/php-datetime-parser-interface library.
Installation
The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.
- Download
composer.phar
from their website. - Then run the following command to install this library as dependency :
php composer.phar php-extended/php-datetime-parser-object ^7
Basic Usage
You may use this library the following way :
use PhpExtended\DateTime\DateTimeImmutableParser();
$dtp = new DateTimeImmutableParser();
$dtp->addFormat('<my custom format>'); // @see DateTime:createFromFormat()
try
{
$dt = $dtp->parse('<my to-be-parsed date-string>');
// $dt instanceof \DateTimeImmutable
// do stgh
}
catch(ParseException $e)
{
// do stgh else
}
License
MIT (See license file).