The Date class provides a basic structure for date and time related information. Date instances can be created by - new Date() for a specific date, - Date.now() to obtain information about the current time, - Date.fromTime() with a given timestamp or - Date.fromString() by parsing from a String.
There is some extra functions available in the DateTools
class.
In the context of haxe dates, a timestamp is defined as the number of milliseconds elapsed since 1st January 1970.
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. - month: 0 to 11 - day: 1 to 31 - hour: 0 to 23 - min: 0 to 59 - sec: 0 to 59
this
Date (1-31 range).this
Date (0-6 range).this
Date (4-digits).this
Date (0-23 range).this
Date (0-59 range).this
Date (0-11 range).this
Date (0-59 range).this
Date, by using the
standard format YYYY-MM-DD HH:MM:SS
. See DateTools.format
for
other formating rules.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.t
.