mathsgod/date

date library for php

1.0.0 2020-04-07 09:18 UTC

This package is auto-updated.

Last update: 2024-12-08 19:51:00 UTC


README

$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

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