Time implements JsonSerializable
Table of Contents
Interfaces
- JsonSerializable
Methods
- __construct() : mixed
- __toString() : string
- getFormat() : string|null
- getOffset() : int
- getRenderFormat() : string
- getTimestamp() : int
- isCorrect() : bool
- jsonSerialize() : mixed
- serialize() : string
- toServerTime() : DateTime
- toSystemObject() : DateTime
- toUserTime() : DateTime
- tryMakeCorrectFormat() : string
Methods
__construct()
public
__construct(string $timeFormatted[, int $offset = 0 ]) : mixed
Parameters
- $timeFormatted : string
- $offset : int = 0
__toString()
public
__toString() : string
Return values
stringgetFormat()
public
static getFormat() : string|null
Return values
string|nullgetOffset()
public
getOffset() : int
Return values
intgetRenderFormat()
public
static getRenderFormat() : string
Return values
stringgetTimestamp()
public
getTimestamp() : int
Return values
intisCorrect()
public
static isCorrect(string $timeFormatted) : bool
Parameters
- $timeFormatted : string
Return values
booljsonSerialize()
public
jsonSerialize() : mixed
serialize()
public
serialize() : string
Return values
stringtoServerTime()
public
toServerTime() : DateTime
Return values
DateTimetoSystemObject()
public
toSystemObject() : DateTime
Return values
DateTimetoUserTime()
public
toUserTime(int $userOffset) : DateTime
Parameters
- $userOffset : int
Return values
DateTimetryMakeCorrectFormat()
public
static tryMakeCorrectFormat(string $timeFormatted[, int $offset = 0 ]) : string
Parameters
- $timeFormatted : string
- $offset : int = 0