lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


mktime() is a function to calculate the number of seconds *since* the epoch. Note the *since*.

Since mktime() returns -1 to signal an error and the last second of 1969 (which is -1 seconds from the epoch) returns the same value that is otherwise used to signal an error, the program misinterprets the result.

In consequence, when mktime() returns -1, you probably should take a look at errno (in C code), as mktime() sets errno accordingly.