$time
$time :
format(string $format = 'Y-m-d H:i:s', string $date = 'now') : string
Formats date.
This function uses the set timezone from TriTan options.
Example Usage:
$datetime = 'May 15, 2018 2:15 PM';
$this->format('Y-m-d H:i:s', $datetime);
string | $format | Format of the date. Default is |
string | $date | Date to be formatted. Default is |
laci2Date(string $format, string $date, boolean $translate = true) : string|integer|boolean
Converts given date string into a different format.
$format should be either a PHP date format string, e.g. 'U' for a Unix timestamp, or 'G' for a Unix timestamp assuming that $date is GMT.
If $translate is true, then the given date and format string will be passed to $this->locale() for translation.
string | $format | Format of the date to return. |
string | $date | Date string to convert. |
boolean | $translate | Whether the return date should be translated. Default true. |
Formatted date string or Unix timestamp. False if $date is empty.
current(string $type, boolean $gmt = false) : integer|string
Returns the current time based on specified type.
The 'laci' type will return the time in the format for LaciDb date field(s). The 'timestamp' type will return the current timestamp. Other strings will be interpreted as PHP date formats (e.g. 'Y-m-d h:i:s').
If $gmt is set to either '1' or 'true', then both types will use GMT time. If $gmt is false, the output is adjusted with the GMT offset based on General Settings.
string | $type | Type of time to return. Accepts 'laci', 'timestamp', or PHP date format string (e.g. 'Y-m-d'). |
boolean | $gmt | Optional. Whether to use GMT timezone. Default false. |
Integer if $type is 'timestamp', string otherwise.