class Date
package js.lib
Creates a JavaScript Date instance that represents a single moment in time. Date objects are based on a time value that is the number of milliseconds since 1 January 1970 UTC.
Static methods
staticUTC(year:Int, month:Int, ?day:Int, ?hours:Int, ?minutes:Int, ?seconds:Int, ?milliseconds:Int):Float
Returns the number of milliseconds since January 1, 1970, 00:00:00 UTC, with leap seconds ignored.
staticnow():Float
Returns the numeric value corresponding to the current time - the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC, with leap seconds ignored
Constructor
Methods
getFullYear():Int
Returns the year (4 digits for 4-digit years) of the specified date according to local time.
getMilliseconds():Int
Returns the milliseconds (0-999) in the specified date according to local time.
getTime():Float
Returns the numeric value of the specified date as the number of milliseconds since January 1, 1970, 00:00:00 UTC (negative for prior times).
getUTCDate():Int
Returns the day (date) of the month (1-31) in the specified date according to universal time.
getUTCFullYear():Int
Returns the year (4 digits for 4-digit years) in the specified date according to universal time.
getUTCMilliseconds():Int
Returns the milliseconds (0-999) in the specified date according to universal time.
setFullYear(value:Int):Void
Sets the full year (e.g. 4 digits for 4-digit years) for a specified date according to local time.
setTime(value:Float):Void
Sets the Date object to the time represented by a number of milliseconds since January 1, 1970, 00:00:00 UTC, allowing for negative numbers for times prior.
setUTCDate(value:Int):Void
Sets the day of the month for a specified date according to universal time.
setUTCFullYear(value:Int):Void
Sets the full year (e.g. 4 digits for 4-digit years) for a specified date according to universal time.
setUTCMilliseconds(value:Int):Void
Sets the milliseconds for a specified date according to universal time.
toJSON():String
Returns a string representing the Date using toISOString(). Intended for use by JSON.stringify().
toLocaleDateString(?locales:String, ?options:Dynamic<Dynamic>):String
toLocaleDateString(?locales:Array<String>, ?options:Dynamic<Dynamic>):String
Returns a string with a locality sensitive representation of the date portion of this date based on system settings.
toLocaleString(?locales:String, ?options:Dynamic<Dynamic>):String
toLocaleString(?locales:Array<String>, ?options:Dynamic<Dynamic>):String
Returns a string with a locality sensitive representation of this date. Overrides the Object.prototype.toLocaleString() method.
toLocaleTimeString(?locales:String, ?options:Dynamic<Dynamic>):String
toLocaleTimeString(?locales:Array<String>, ?options:Dynamic<Dynamic>):String
Returns a string with a locality sensitive representation of the time portion of this date based on system settings.
toSource():String
Returns a string representing the source for an equivalent Date object; you can use this value to create a new object. Overrides the Object.prototype.toSource() method.