Haxe API Documentation
Back |
Indexclass DateTools
Available in flash8, neko, js, flash, php, cpp
The DateTools class contains some extra functionalities for handling Date
instances and timestamps.
In the context of haxe dates, a timestamp is defined as the number of
milliseconds elapsed since 1st January 1970.
- static inline function days(n : Float) : Float
- Converts a number of days to a timestamp.
- static inline function delta(d : Date, t : Float) : Date
Returns the result of adding timestamp t
to Date d
.
This is a convenience function for calling
Date.fromTime(d.getTime() + t).
- static function format(d : Date, f : String) : String
- Format the date
d
according to the format f
. The format is
compatible with the strftime
standard format, except that there is no
support in Flash and JS for day and months names (due to lack of proper
internationalization API). On haXe/Neko/Windows, some formats are not
supported. - static function getMonthDays(d : Date) : Int
Returns the number of days in the month of Date d
.
This method handles leap years.
- static inline function hours(n : Float) : Float
- Converts a number of hours to a timestamp.
- static function make(o : { seconds : Int, ms : Float, minutes : Int, hours : Int, days : Int}) : Float
- Build a date-time from several components
- static function makeUtc(year : Int, month : Int, day : Int, hour : Int, min : Int, sec : Int) : Float
Available in flash8, js, flash, php, cpp
- Retrieve Unix timestamp value from Date components. Takes same argument sequence as the Date constructor.
- static inline function minutes(n : Float) : Float
- Converts a number of minutes to a timestamp.
- static function parse(t : Float) : { seconds : Int, ms : Float, minutes : Int, hours : Int, days : Int}
- Separate a date-time into several components
- static inline function seconds(n : Float) : Float
- Converts a number of seconds to a timestamp.
Back |
Index