TwistPHP Documentation

DateTime

File path: dist/twist/Core/Utilities/DateTime.utility.php
Namespace: Twist\Core\Utilities
Extends: Base

Type: Utility

DateTime — Simply format data and time strings, generate human readable age of any given date. For example 120 will become "2 minutes" provide a timestamp and the age can be presented as "10 minutes ago". Work with date ranges and producing on screen calendars.

Example Usage

<?php
//Set the variables for the example
$strFormat 'Y-m-d;
$intTimestamp = null;

//Call the function date with the example vars
Twist::DateTime() -> date($strFormat, $intTimestamp);

Method List

Method Access Returns
__constructconstructvoid
timepublicvoid
datepublicvoid
inFuturepublicvoid
inPastpublicvoid
prettyAgepublicvoid
prettyTimepublicvoid
getAgepublicvoid
getTimePeriodpublicvoid
getPersonAgepublicvoid
getDayBetweenDatespublicvoid