Date component is a set of methods to help with the manipulation of dates.
Installs: 4 630
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.1.3
This package is auto-updated.
Last update: 2024-12-11 15:18:53 UTC
README
Date component is a set of methods to help with the manipulation of dates.
Installation
composer require flextype-components/date
Usage
use Flextype\Component\Date\Date;
Get format date
echo Date::format($date, 'j.n.Y');
Get number of seconds in a minute, incrementing by a step.
$seconds = Date::seconds();
Get number of minutes in a hour, incrementing by a step.
$minutes = Date::minutes();
Get number of hours, incrementing by a step.
$hours = Date::hours();
Get number of months.
$months = Date::months();
Get number of days.
$months = Date::days();
Returns the number of days in the requested month
$days = Date::daysInMonth(1);
Get number of years.
$years = Date::years();
Get current season name
echo Date::season();
Get today date
echo Date::today();
Get yesterday date
echo Date::yesterday();
Get tomorrow date
echo Date::tomorrow();
Converts a UNIX timestamp to DOS format.
$dos = Date::unix2dos($unix);
Converts a DOS timestamp to UNIX format.
$unix = Date::dos2unix($dos);
Get Time zones
$tz = Date::timezones();
License
See LICENSE