Function __global->cms_date
Definitions
sources/temporal.php
- Format a local time/date according to language pack. Uses 'date' syntax, with the software's locale filter.Does not depend on actual locales, which are not thread-safe.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $format | string | No | No | required parameter | N/A | N/A | The formatting string |
| $timestamp | ?TIME | No | No | Null | N/A | N/A | The timestamp (null: now). Assumed to already be timezone-shifted as required |
Returns
- The formatted string
- Type: string
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Format a local time/date according to language pack. Uses 'date' syntax, with the software's locale filter.Does not depend on actual locales, which are not thread-safe.
*
* @param string $format The formatting string
* @param ?TIME $timestamp The timestamp (null: now). Assumed to already be timezone-shifted as required
* @return string The formatted string
*/
function cms_date(string $format, ?int $timestamp = null) : string
* Format a local time/date according to language pack. Uses 'date' syntax, with the software's locale filter.Does not depend on actual locales, which are not thread-safe.
*
* @param string $format The formatting string
* @param ?TIME $timestamp The timestamp (null: now). Assumed to already be timezone-shifted as required
* @return string The formatted string
*/
function cms_date(string $format, ?int $timestamp = null) : string

