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

https://github.com/mathsgod/date

date library for php
https://github.com/mathsgod/date

Last synced: about 1 year ago
JSON representation

date library for php

Awesome Lists containing this project

README

          

# Date
```php
$date = Date::Create(2000, 1, 1);
echo $date->year; //2000
echo $date->month; //1
echo $date->day; //1

$date = Date::Now(); //now
$date->addYears(1); //next year
$date->addDays(1);
$date->addMonths(1);

$tomorrow = Date::CreateFromString("tomorrow"); //tomorrow
```

# DateRange
```php
$range = DateRange::Create("2020-01-01", "2020-12-31");
echo $range->contains("2020-03-01"); //true
echo $range->contains("2019-03-01"); //false

```