Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 752 Bytes

localtime.adoc

File metadata and controls

37 lines (30 loc) · 752 Bytes

localtime()

Important

Deprecated in 5.0.

Please use [class-datetime] class.

localtime(time) => void

Converts time in UNIX format (number of seconds since epoch) to calendar date and time broken down into its components, using server time zone. Function uses either time given in time argument or current time if time is omitted.

Table 1. Parameters

time

Integer

Time as seconds since epoch (1 January 1970 00:00:00 UTC). If omitted, current time is used.

Return

[class-datetime] object.

Example
println(localtime(time()).year); //Will print 2020
println(localtime().year); //Will print 2020