Skip to content

flextype-components/date

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Date Component

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