Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gugiman/dateperiodparser8601
PHP Class for rudimental parsing of ISO8601 DatePeriods user e.g. by Amazon Alexas Slot type "AMAZON.DATE"
https://github.com/gugiman/dateperiodparser8601
alexa amazon amazon-alexa composer dateperiod daterange iso8601 php php8 skill
Last synced: about 1 month ago
JSON representation
PHP Class for rudimental parsing of ISO8601 DatePeriods user e.g. by Amazon Alexas Slot type "AMAZON.DATE"
- Host: GitHub
- URL: https://github.com/gugiman/dateperiodparser8601
- Owner: Gugiman
- License: mit
- Created: 2019-04-02T13:03:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-08T08:27:34.000Z (over 1 year ago)
- Last Synced: 2024-11-15T21:38:51.128Z (about 1 month ago)
- Topics: alexa, amazon, amazon-alexa, composer, dateperiod, daterange, iso8601, php, php8, skill
- Language: PHP
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DatePeriodParser8601
PHP Class for rudimental parsing of ISO8601 DatePeriods e.g. by Amazon Alexas Slot type [AMAZON.DATE](https://developer.amazon.com/de/docs/custom-skills/slot-type-reference.html#date)## Install via composer
Require the package with composer:
```
composer require gugiman/date-period-parser8601
```## Using
Use like seen in test.php```php
getStart();
// returns \DateTime object of start// $obj->getStart()->format("d.m.Y H:i:s");
// returns 22.06.2022 00:00:00$obj->getEnd();
// returns \DateTime object of end// $obj->getEnd()->format("d.m.Y H:i:s");
// returns 23.06.2022 23:59:59// returns \DatePeriod object with given interval
$obj->asDatePeriod(new \DateInterval("P1D"));
```## Donation
BTC: 1Gn4ofNXpvwYSvyi2wC1kT3Hoas3kaifqx
ETH (ERC20): 0x07d2b052abb86df996276fcc327296f344781ae8