This PHP DataTimeHelper class includes several methods to validate dates and like checking of the date is in the future or has expired or is between two dates and even to check if the weekday is Friday.
####addDays
$DateTime = (new DateHelper('2020-06-30'))
->addDays(1);
$isTrue = (new DateHelper('2020-06-30'))
->isBetween(
new DateTime('2020-01-03'),
new DateTime('2021-01-03')
);
$isTrue = (new DateHelper('2020-06-30'))
->isBetweenDate(
new DateTime('2020-06-30'),
new DateTime('2021-01-03')
);
$isTrue = (new DateHelper('NOW'))
->isDate(new DateTime('NOW'));
$isTrue = (new DateHelper('2020-06-30'))
->isExpired(
new DateTime('2020-01-03')
);
$isTrue = (new DateHelper('2020-06-30'))
->isUpcoming(
new DateTime('2020-07-30')
);
$isTrue = (new DateHelper('2020-06-28'))
->isMonday();
$isTrue = (new DateHelper('2020-06-29'))
->isTuesday();
$isTrue = (new DateHelper('2020-07-01'))
->isWednesday();
$isTrue = (new DateHelper('2020-07-02'))
->isThursday();
$isTrue = (new DateHelper('2020-07-03'))
->isFriday();
$isTrue = (new DateHelper('2020-07-04'))
->isSaturday();
$isTrue = (new DateHelper('2020-07-05'))
->isSunday();