haXe API Documentation
Back | Index
class 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
static inline function delta(d : Date, t : Float) : Date
static function format(d : Date, f : String) : String
Available in neko, php
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 format(d : Date, f : String) : String
Available in flash8, js, flash, cpp
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
static function make(o : { seconds : Int, ms : Float, minutes : Int, hours : Int, days : Int}) : Float
static function makeUtc(year : Int, month : Int, day : Int, hour : Int, min : Int, sec : Int) : Float
Available in flash8, js, flash, php, cpp
static inline function minutes(n : Float) : Float
static function parse(t : Float) : { seconds : Int, ms : Float, minutes : Int, hours : Int, days : Int}
static inline function seconds(n : Float) : Float
Back | Index