Time implements Time
Interfaces, Classes and Traits
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
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
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
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
Return values
mixed —getDateFormat()
Get the time format.
public
static getDateFormat() : string
Tags
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
Return values
bool —now()
Get "now" time.
public
static now([string $timezone = '' ]) : int
Parameters
- $timezone : string = ''
-
Valid php supported timezone.
Tags
Return values
int —setDateFormat()
Set the time format.
public
static setDateFormat(mixe $format) : object
Parameters
- $format : mixe
-
Valiud Date/Time format.
Tags
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
Return values
string —validateDateFormat()
Validate the time format.
public
static validateDateFormat(mixe $format) : bool
Parameters
- $format : mixe
-
Valiud Date/Time format.
Tags
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
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)