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
- Host: GitHub
- URL: https://github.com/mathsgod/date
- Owner: mathsgod
- License: mit
- Created: 2020-04-07T07:31:36.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-08T09:16:25.000Z (about 6 years ago)
- Last Synced: 2025-03-13T09:03:24.920Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```