Difference between revisions of "Os.time"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
 
Returns the current time when called without arguments, or a time representing the date and time specified by the given table. This table must have fields year, month, and day, and may have fields hour, min, sec, and isdst (for a description of these fields, see the os.date function).  
 
Returns the current time when called without arguments, or a time representing the date and time specified by the given table. This table must have fields year, month, and day, and may have fields hour, min, sec, and isdst (for a description of these fields, see the os.date function).  
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
(number) = os.time(table)
 
(number) = os.time(table)
 
</source>
 
</source>

Revision as of 14:30, 13 July 2023

Available since: Gideros 2011.6
Class: os

Description

Returns the current time when called without arguments, or a time representing the date and time specified by the given table. This table must have fields year, month, and day, and may have fields hour, min, sec, and isdst (for a description of these fields, see the os.date function). <syntaxhighlight lang="lua"> (number) = os.time(table) </source>

The returned value is a number, whose meaning depends on your system. In POSIX, Windows, and some other systems, this number counts the number of seconds since some given start time (the "epoch": 1 January 1970, 00:00:00). In other systems, the meaning is not specified, and the number returned by time can be used only as an argument to date and difftime

Parameters

table: (table) table representing a date time optional

Return values

Returns (number) time in seconds