Documentation

Time implements Time

Interfaces, Classes and Traits

Time

Table of Contents

$dateFormat  : string
Date format.
ago()  : mixed
Converts the timestamp in to ago form.
daysInMonth()  : int
Number of days in a month.
formatsSeconds()  : mixed
Converts the timestamp in to h:m:s form.
getDateFormat()  : string
Get the time format.
isLeapYear()  : bool
Determine whether the year is leap or not.
now()  : int
Get "now" time.
setDateFormat()  : object
Set the time format.
timestampToGmt()  : string
Converts a timestamp to GMT.
validateDateFormat()  : bool
Validate the time format.
formatTime()  : int
Formats the time.
timestampToDate()  : string
Converts a timestamp to DateTime.

Properties

$dateFormat

Date format.

private static string $dateFormat
Tags
since
1.0.0

Methods

ago()

Converts the timestamp in to ago form.

public static ago(mixed $dateTime[, mixed $full = false ]) : mixed
Parameters
$dateTime : mixed
$full : mixed = false
Tags
author

https://github.com/peter279k (https://github.com/alphazframework/framework/pull/206).

since
1.0.0
Return values
mixed

daysInMonth()

Number of days in a month.

public static daysInMonth([int $month = 1 ][, int $year = 1970 ]) : int
Parameters
$month : int = 1

A numeric month.

$year : int = 1970

A numeric year.

Tags
since
1.0.0
Return values
int

formatsSeconds()

Converts the timestamp in to h:m:s form.

public static formatsSeconds(mixed $seconds[, string $timezone = '' ]) : mixed
Parameters
$seconds : mixed
$timezone : string = ''

Valid php supported timezone.

Tags
since
1.0.0
Return values
mixed

getDateFormat()

Get the time format.

public static getDateFormat() : string
Tags
since
1.0.0
Return values
string

isLeapYear()

Determine whether the year is leap or not.

public static isLeapYear([int $year = null ]) : bool
Parameters
$year : int = null

A numeric year.

Tags
since
1.0.0
Return values
bool

now()

Get "now" time.

public static now([string $timezone = '' ]) : int
Parameters
$timezone : string = ''

Valid php supported timezone.

Tags
since
1.0.0
Return values
int

setDateFormat()

Set the time format.

public static setDateFormat(mixe $format) : object
Parameters
$format : mixe

Valiud Date/Time format.

Tags
since
1.0.0
Return values
object

timestampToGmt()

Converts a timestamp to GMT.

public static timestampToGmt([int|null $time = null ]) : string
Parameters
$time : int|null = null

Unix timestamp

Tags
since
1.0.0
Return values
string

validateDateFormat()

Validate the time format.

public static validateDateFormat(mixe $format) : bool
Parameters
$format : mixe

Valiud Date/Time format.

Tags
since
1.0.0
Return values
bool

formatTime()

Formats the time.

protected static formatTime((int|string) $time) : int
Parameters
$time : (int|string)

Timestamp or English textual datetime (http://php.net/manual/en/function.strtotime.php)

Tags
since
1.0.0
author

https://github.com/Maikuolan (https://github.com/alphazframework/framework/issues/131)

Return values
int

timestampToDate()

Converts a timestamp to DateTime.

private static timestampToDate([int|string $time = null ]) : string
Parameters
$time : int|string = null

Datetime, Timestamp or English textual datetime (http://php.net/manual/en/function.strtotime.php)

Tags
since
1.0.0
Return values
string

Search results