Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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"

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