strftime()

Deprecated in 5.0.

Please use format() method of DateTime class.

strftime(string, time, isLocalTime): String

Formats a Unix timestamp, and returns a string according to given formatting rules.

Table 1. Parameters

string

String

Formatting string - see this for available options http://www.cplusplus.com/reference/ctime/strftime/

time

Integer

Optional. UNIX time (number of seconds since epoch). Current time is used if omitted or null.

isLocalTime

Boolean

Optional. true (default) to format the time in the server’s local time zone, false to format it as UTC.

Return

Formatted time as a string.

println(strftime("%Y-%m-%d %H:%M", time())); //Will print: "2016-01-19 12:14"
println(strftime("%Y-%m-%d %H:%M - timezone %Z - offset from UTC - %z", time())); //Will print: "2016-01-19 12:14 - timezone CET - offset from UTC - +0100"