newDate

Top  Previous  Next

Creates a new Date object. The value of the date is dependent on the optional parameter passed along.

Definition

Date = date.newDate( param )

 

Name

Type

Description

param [optional]

string or number

When a string is passed the function tries to parse it into a date and time. If a number is passed it is interpreted as the number of seconds since January 1st 1970, 0:00 UTC.

Date

Date Object

Date return value object.

Example

local d = date.newDate(6 * 3600)

print(d)

 

 

This will print

 

Thu Jan 1 01:00:00 1970

 

If this function was run in the Eastern time zone (UTC -5)

Related

Date Object

Availability

Lua