Home  Contents

os.time

OS Lua Commands

SYNOPSIS

os.time([table])

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).

The returned value is the number of seconds since the POSIX epoch: 1. Jan 1970, midnight, UTC.

RETURN VALUE

Returns an integer.

NOTES

This function is part of the original Lua specification. We recommend using the Core4 specific date/time functions instead.

Bugs

This function suffers from the Year 2038 problem.

EXAMPLE

print(os.time())
12003788

SEE ALSO