Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabiang/dateparser
Date parsing library supporting the full format RFC3339
https://github.com/fabiang/dateparser
date dateparser datetime parser php rfc3339
Last synced: 3 months ago
JSON representation
Date parsing library supporting the full format RFC3339
- Host: GitHub
- URL: https://github.com/fabiang/dateparser
- Owner: fabiang
- License: other
- Created: 2017-07-25T18:54:54.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2024-01-24T13:13:33.000Z (12 months ago)
- Last Synced: 2024-04-25T11:43:29.652Z (9 months ago)
- Topics: date, dateparser, datetime, parser, php, rfc3339
- Language: PHP
- Homepage:
- Size: 67.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# fabiang/dateparser
Date parsing library supporting the full format RFC3339. The following formats are supported:
```
2017-07-25T18:37:40
2017-07-25T18:37:40.1234567890
2017-07-25T18:37:40.1234567890Z
2017-07-25T18:37:40Z
2017-07-25T18:37:40.1234567890+0200
2017-07-25T18:37:40+0200
2017-07-25T18:37:40.1234567890-0400
2017-07-25T18:37:40-0400
2017-07-25T18:37:40.1234567890+02:00
2017-07-25T18:37:40+02:00
2017-07-25T18:37:40.1234567890-04:00
```**Note:** PHP only supports 6 digit microseconds. This library cut the last digits off.
[![PHP Version Require](http://poser.pugx.org/fabiang/dateparser/require/php)](https://packagist.org/packages/fabiang/dateparser)
[![Latest Stable Version](http://poser.pugx.org/fabiang/dateparser/v)](https://packagist.org/packages/fabiang/dateparser)
[![License](http://poser.pugx.org/fabiang/dateparser/license)](https://packagist.org/packages/fabiang/dateparser)
[![Continuous Integration](https://github.com/fabiang/dateparser/actions/workflows/ci.yml/badge.svg)](https://github.com/fabiang/dateparser/actions/workflows/ci.yml)## Installation
Run Composer with:
```
composer require fabiang/dateparser
```## Usage
Parsing an RFC3339 datetime string:
```php
use Fabiang\Dateparser\RFC3339;$parser = new RFC3339();
$datetime = $parser->parse('2017-07-25T18:37:40+02:00'); // DateTime object
```## Licence
BSD-2-Clause. See the [LICENSE.md](LICENSE.md).