Module jls.util.Date

Represents a date time with a time zone or using UTC.

Class Date

Date:new ([year[, month[, day[, hour[, min[, sec[, ms]]]]]]]) Creates a new Date.
date:getYear () Returns the year of this date.
date:getMonth () Returns the year of this date.
date:getDay () Returns the year of this date.
date:getWeekDay () Returns the year of this date.
date:getHours () Returns the year of this date.
date:getMinutes () Returns the year of this date.
date:getSeconds () Returns the year of this date.
date:getMilliseconds () Returns the year of this date.
date:getTime () Returns the number of milliseconds since epoch, 1970-01-01T00:00:00 UTC, represented by this date.
date:compareTo (d) Compares the specified date to this date.
Date.now () Returns the number of milliseconds since epoch, 1970-01-01T00:00:00 UTC.
Date.UTC (year[, month[, day[, hour[, min[, sec[, ms]]]]]]) Returns the number of milliseconds since epoch for the specified date time.


Class Date

The Date class. The Date provides a way to manipulate date and time. The Date represents the number of milliseconds since epoch, 1970-01-01T00:00:00 UTC.
Date:new ([year[, month[, day[, hour[, min[, sec[, ms]]]]]]])
Creates a new Date. With no parameters, the date represents the current date and time.

Parameters:

  • year number the year or the the number of milliseconds since epoch (optional)
  • month number the month (optional)
  • day number the day (optional)
  • hour number the hour (optional)
  • min number the min (optional)
  • sec number the sec (optional)
  • ms number the ms (optional)

Returns:

    a new Date

Usage:

    Date:new(2017, 12, 4, 0, 1, 18) or Date:new(2017, 12)
     Date:new() or Date:new(1512345678000)
date:getYear ()
Returns the year of this date.

Returns:

    number the year.
date:getMonth ()
Returns the year of this date.

Returns:

    number the year.
date:getDay ()
Returns the year of this date.

Returns:

    number the year.
date:getWeekDay ()
Returns the year of this date.

Returns:

    number the year.
date:getHours ()
Returns the year of this date.

Returns:

    number the year.
date:getMinutes ()
Returns the year of this date.

Returns:

    number the year.
date:getSeconds ()
Returns the year of this date.

Returns:

    number the year.
date:getMilliseconds ()
Returns the year of this date.

Returns:

    number the year.
date:getTime ()
Returns the number of milliseconds since epoch, 1970-01-01T00:00:00 UTC, represented by this date.

Returns:

    number the number of milliseconds since epoch
date:compareTo (d)
Compares the specified date to this date.

Parameters:

  • d the date to compare to

Returns:

    number 0 if the dates are equals, less than 0 if this date is before the specified date, more than 0 if this date is after the specified date
Date.now ()
Returns the number of milliseconds since epoch, 1970-01-01T00:00:00 UTC.

Returns:

    number the number of milliseconds since epoch
Date.UTC (year[, month[, day[, hour[, min[, sec[, ms]]]]]])
Returns the number of milliseconds since epoch for the specified date time.

Parameters:

  • year number the year
  • month number the month (optional)
  • day number the day (optional)
  • hour number the hour (optional)
  • min number the min (optional)
  • sec number the sec (optional)
  • ms number the ms (optional)

Returns:

    number the number of milliseconds since epoch
generated by LDoc 1.4.6