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 methods

staticinline delta (d:Date, t:Float):Date

Available on js-client, js-node

Returns the result of adding timestamp t to Date d.

This is a convenience function for calling Date.fromTime(d.getTime() + t).

staticformat (d:Date, f:String):String

Available on 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.