Date component is a set of methods to help with the manipulation of dates.

v1.1.0 2019-09-10 18:29 UTC

This package is auto-updated.

Last update: 2024-12-11 15:18:53 UTC


README

version MIT License

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