package js.lib
Available on js
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.
staticUTC(year:Int, month:Int, ?day:Int, ?hours:Int, ?minutes:Int, ?seconds:Int, ?milliseconds:Int):FloatReturns the number of milliseconds since January 1, 1970, 00:00:00 UTC, with leap seconds ignored.
staticinlinefromHaxeDate(date:HaxeDate):DateCast Haxe's Date to js.lib.Date.
staticnow():FloatReturns 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
staticparse(str:String):FloatParses a string representation of a date and returns the number of milliseconds since 1 January, 1970, 00:00:00, UTC, with leap seconds ignored.
staticinlinetoHaxeDate(date:Date):HaxeDateCast js.lib.Date to Haxe's Date.
new()new(value:Float)new(dateString:String)new(year:Int, month:Int, ?day:Int, ?hours:Int, ?minutes:Int, ?seconds:Int, ?milliseconds:Int)getDate():IntReturns the day of the month (1-31) for the specified date according to local time.
getDay():IntReturns the day of the week (0-6) for the specified date according to local time.
getFullYear():IntReturns the year (4 digits for 4-digit years) of the specified date according to local time.
getHours():IntReturns the hour (0-23) in the specified date according to local time.
getMilliseconds():IntReturns the milliseconds (0-999) in the specified date according to local time.
getMinutes():IntReturns the minutes (0-59) in the specified date according to local time.
getMonth():IntReturns the month (0-11) in the specified date according to local time.
getSeconds():IntReturns the seconds (0-59) in the specified date according to local time.
getTime():FloatReturns the numeric value of the specified date as the number of milliseconds since January 1, 1970, 00:00:00 UTC (negative for prior times).
getTimezoneOffset():IntReturns the time-zone offset in minutes for the current locale.
getUTCDate():IntReturns the day (date) of the month (1-31) in the specified date according to universal time.
getUTCDay():IntReturns the day of the week (0-6) in the specified date according to universal time.
getUTCFullYear():IntReturns the year (4 digits for 4-digit years) in the specified date according to universal time.
getUTCHours():IntReturns the hours (0-23) in the specified date according to universal time.
getUTCMilliseconds():IntReturns the milliseconds (0-999) in the specified date according to universal time.
getUTCMinutes():IntReturns the minutes (0-59) in the specified date according to universal time.
getUTCMonth():IntReturns the month (0-11) in the specified date according to universal time.
getUTCSeconds():IntReturns the seconds (0-59) in the specified date according to universal time.
setDate(value:Int):VoidSets the day of the month for a specified date according to local time.
setFullYear(value:Int):VoidSets the full year (e.g. 4 digits for 4-digit years) for a specified date according to local time.
setHours(value:Int):VoidSets the hours for a specified date according to local time.
setMilliseconds(value:Int):VoidSets the milliseconds for a specified date according to local time.
setMinutes(value:Int):VoidSets the minutes for a specified date according to local time.
setMonth(value:Int):VoidSets the month for a specified date according to local time.
setSeconds(value:Int):VoidSets the seconds for a specified date according to local time.
setTime(value:Float):VoidSets 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):VoidSets the day of the month for a specified date according to universal time.
setUTCFullYear(value:Int):VoidSets the full year (e.g. 4 digits for 4-digit years) for a specified date according to universal time.
setUTCHours(value:Int):VoidSets the hour for a specified date according to universal time.
setUTCMilliseconds(value:Int):VoidSets the milliseconds for a specified date according to universal time.
setUTCMinutes(value:Int):VoidSets the minutes for a specified date according to universal time.
setUTCMonth(value:Int):VoidSets the month for a specified date according to universal time.
setUTCSeconds(value:Int):VoidSets the seconds for a specified date according to universal time.
toDateString():StringReturns the "date" portion of the Date as a human-readable string.
toISOString():StringConverts a date to a string following the ISO 8601 Extended Format.
toJSON():StringReturns a string representing the Date using toISOString(). Intended for use by JSON.stringify().
toLocaleDateString(?locales:String, ?options:Dynamic<Dynamic>):StringtoLocaleDateString(?locales:Array<String>, ?options:Dynamic<Dynamic>):StringReturns a string with a locality sensitive representation of the date portion of this date based on system settings.
toLocaleFormat(format:String):StringConverts a date to a string, using a format string.
toLocaleString(?locales:String, ?options:Dynamic<Dynamic>):StringtoLocaleString(?locales:Array<String>, ?options:Dynamic<Dynamic>):StringReturns a string with a locality sensitive representation of this date. Overrides the Object.prototype.toLocaleString() method.
toLocaleTimeString(?locales:String, ?options:Dynamic<Dynamic>):StringtoLocaleTimeString(?locales:Array<String>, ?options:Dynamic<Dynamic>):StringReturns a string with a locality sensitive representation of the time portion of this date based on system settings.
toSource():StringReturns 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.
toString():StringReturns a string representing the specified Date object. Overrides the Object.prototype.toString() method.
toTimeString():StringReturns the "time" portion of the Date as a human-readable string.
toUTCString():StringConverts a date to a string using the UTC timezone.
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/lib/Date.html