Difference between revisions of "NXSL:strftime"
Jump to navigation
Jump to search
Tomas Kirnak (talk | contribs) |
m (Text replacement - "^" to "{{deprecated}}") |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
{{ | {{deprecated}}__NOTOC__ | ||
Formats a Unix timestamp, and returns a string according to given formatting rules. | |||
== Syntax == | |||
strftime(''string''); | |||
== Parameters == | |||
:{| | |||
|- | |||
| ''string'' || Formatting string - see this for available options http://www.cplusplus.com/reference/ctime/strftime/ | |||
|} | |||
== Return Value == | |||
Formatted time as a string. | |||
== Examples == | |||
<pre> | |||
strftime("%Y-%m-%d %H:%M", time()) -> 2016-01-19 12:14 | |||
strftime("%Y-%m-%d %H:%M - timezone %Z - offset from UTC - %z", time()) -> 2016-01-19 12:14 - timezone CET - offset from UTC - +0100 | |||
</pre> |
Latest revision as of 16:13, 13 September 2022
This Wiki is deprecated and we are are currrently migrating remaining pages into product documentation (Admin Guide, NXSL Guide) |
Formats a Unix timestamp, and returns a string according to given formatting rules.
Syntax
strftime(string);
Parameters
string Formatting string - see this for available options http://www.cplusplus.com/reference/ctime/strftime/
Return Value
Formatted time as a string.
Examples
strftime("%Y-%m-%d %H:%M", time()) -> 2016-01-19 12:14 strftime("%Y-%m-%d %H:%M - timezone %Z - offset from UTC - %z", time()) -> 2016-01-19 12:14 - timezone CET - offset from UTC - +0100