Using this object you can work with date.


Can be created with new method, as current date, from timestamp or string:

Lib.Sys.Date.new(year, month, day, hour, min, sec)

Creates a new date object from the given arguments.
The behaviour of a Date instance is only consistent across platforms if the the arguments describe a valid date.

year - year

month - 0 to 11
day - 1 to 31
hour - 0 to 23
min - 0 to 59
sec - 0 to 59

Lib.Sys.Date.now()

Returns a Date representing the current local time.


Lib.Sys.Date.fromTime(t)

Returns a Date from timestamp t.

t - timestamp (float) seconds with fractions

Lib.Sys.Date.fromString(s)

Returns a Date from a formated string s, with the following accepted formats:
- YYYY-MM-DD hh:mm:ss
- YYYY-MM-DD
- hh:mm:ss
The first two formats are expressed in local time, the third in UTC Epoch.

s - formated date string


Created object has methods:

getTime()

Returns the timestamp (in milliseconds) of the date. It might only have a per-second precision depending on the platforms.


getHours()

Returns the hours of `this` Date (0-23 range).


getMinutes()

Returns the minutes of `this` Date (0-59 range).


getSeconds()

Returns the seconds of `this` Date (0-59 range).


getFullYear()

Returns the full year of `this` Date (4-digits).


getMonth()

Returns the month of `this` Date (0-11 range).


getDate()

Returns the day of `this` Date (1-31 range).


getDay()

Returns the day of the week of `this` Date (0-6 range) where `0` is Sunday.


toString()

Returns a string representation of created Date object, by using the
standard format [YYYY-MM-DD HH:MM:SS]. See Lib.Sys.DateTools.format for
other formating rules.


Created with the Personal Edition of HelpNDoc: Free EBook and documentation generator