ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. formatDate

Function

formatDate

Server and clientUtilitiesTrilogy Hub only

Returns a date as text using a mask. Supports %d, %m, %Y, %y, %H, %M, %S and %%. Without a timestamp it uses the current time.

Syntax

string formatDate(string format [, int timestamp = nil])

Arguments

formatstring
A mask, e.g. "%d.%m.%Y %H:%M".
timestampint, optional = nil
Time in seconds since 1970.

Returns

The date as text.

Example

outputChatBox("Serwer działa od " .. formatDate("%d.%m.%Y %H:%M"))

See also