Strftime

From Zandronum Wiki
Revision as of 17:35, 21 August 2016 by DrinkyBird (talk | contribs) (Created page with "{{Template:ACSWarning}} {{devfeature|3.0|150831-1814}} str '''Strftime'''(int timestamp, str format['', int utc'']) __NOTOC__ == Usage == === Parameters === * ''timestamp'':...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This article documents a Zandronum-specific ACS feature which may not be supported by ZDoom and its other child ports.

(development version 3.0-150831-1814 and above only)

str Strftime(int timestamp, str format[, int utc])

Usage

Parameters

  • timestamp: the timestamp to format (use SystemTime to get the current time])
  • format: a string describing how the string is formatted. It may contain any supported conversion specifiers, which are replaced as appropriate.
  • utc: If true, then the timestamp will be localized using the UTC timezone, local timezone otherwise.

Return value

A human-readable string from the given timestamp, formatted using the format parameter.

Note that due to ACS's limitations, timestamps are suspectible to the year 2038 problem.

Example

This prints something like April 28 2024 to the screen.

Script 1 (void)
{
    Print (s: Strftime (SystemTime(), "%B %d %Y", true));
}

See Also