DateTools

class DateToolsAvailable in flash8, flash, neko, js, php, cpp, cs, javaThe DateTools class contains some extra functionalities for Date manipulation. It's stored in a different class in order to prevent the standard Date of being bloated and thus increasing the size of each application using it. static inline function days( n : Float ) : FloatConvert a number of days to a date-time static inline function delta( d : Date, t : Float ) : DateReturns a Date which time has been changed by t milliseconds. static function format( d : Date, f : String ) : StringFormat 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) and the %e format is supported. On Haxe/Neko/Windows, some formats are not supported. static function getMonthDays( d : Date ) : IntReturns the number of days in a month static inline function hours( n : Float ) : FloatConvert a number of hours to a date-time static function make( o : { seconds : Int, ms : Float, minutes : Int, hours : Int, days : Int } ) : FloatBuild a date-time from several components static function makeUtc( year : Int, month : Int, day : Int, hour : Int, min : Int, sec : Int ) : FloatAvailable in flash8, flash, js, php, cpp static inline function minutes( n : Float ) : FloatConvert a number of minutes to a date-time 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 ) : FloatConvert a number of seconds to a date-time
version #19307, modified 2013-05-08 11:13:09 by api
1 comment
  • Apr 12, 2014 at 18:44

    Syntax Example:

    var t = DateTools.format(Date.now(),"%Y-%m-%d_%H:%M:%S")
    String : 2014-04-12_09:07:10