Module Js.Date
Bindings to the functions in JS's Date.prototype
JavaScript Date API
ocaml
type treasonml
type t;ocaml
val valueOf : t -> floatreasonml
let valueOf: t => float;returns the primitive value of this date, equivalent to getTime
ocaml
val fromFloat : float -> treasonml
let fromFloat: float => t;ocaml
val fromString : string -> treasonml
let fromString: string => t;ocaml
val make :
?year:float ->
?month:float ->
?date:float ->
?hours:float ->
?minutes:float ->
?seconds:float ->
unit ->
treasonml
let make:
?year:float =>
?month:float =>
?date:float =>
?hours:float =>
?minutes:float =>
?seconds:float =>
unit =>
t;make () returns a date representing the current time.
ocaml
val utc :
year:float ->
?month:float ->
?date:float ->
?hours:float ->
?minutes:float ->
?seconds:float ->
unit ->
floatreasonml
let utc:
year:float =>
?month:float =>
?date:float =>
?hours:float =>
?minutes:float =>
?seconds:float =>
unit =>
float;ocaml
val now : unit -> floatreasonml
let now: unit => float;returns the number of milliseconds since Unix epoch
ocaml
val parseAsFloat : string -> floatreasonml
let parseAsFloat: string => float;returns NaN if passed invalid date string
ocaml
val getDate : t -> floatreasonml
let getDate: t => float;return the day of the month (1-31)
ocaml
val getDay : t -> floatreasonml
let getDay: t => float;returns the day of the week (0-6)
ocaml
val getFullYear : t -> floatreasonml
let getFullYear: t => float;ocaml
val getHours : t -> floatreasonml
let getHours: t => float;ocaml
val getMilliseconds : t -> floatreasonml
let getMilliseconds: t => float;ocaml
val getMinutes : t -> floatreasonml
let getMinutes: t => float;ocaml
val getMonth : t -> floatreasonml
let getMonth: t => float;returns the month (0-11)
ocaml
val getSeconds : t -> floatreasonml
let getSeconds: t => float;ocaml
val getTime : t -> floatreasonml
let getTime: t => float;returns the number of milliseconds since Unix epoch
ocaml
val getTimezoneOffset : t -> floatreasonml
let getTimezoneOffset: t => float;ocaml
val getUTCDate : t -> floatreasonml
let getUTCDate: t => float;return the day of the month (1-31)
ocaml
val getUTCDay : t -> floatreasonml
let getUTCDay: t => float;returns the day of the week (0-6)
ocaml
val getUTCFullYear : t -> floatreasonml
let getUTCFullYear: t => float;ocaml
val getUTCHours : t -> floatreasonml
let getUTCHours: t => float;ocaml
val getUTCMilliseconds : t -> floatreasonml
let getUTCMilliseconds: t => float;ocaml
val getUTCMinutes : t -> floatreasonml
let getUTCMinutes: t => float;ocaml
val getUTCMonth : t -> floatreasonml
let getUTCMonth: t => float;returns the month (0-11)
ocaml
val getUTCSeconds : t -> floatreasonml
let getUTCSeconds: t => float;ocaml
val setDate : date:float -> t -> floatreasonml
let setDate: date:float => t => float;ocaml
val setFullYear : year:float -> ?month:float -> ?date:float -> t -> floatreasonml
let setFullYear: year:float => ?month:float => ?date:float => t => float;ocaml
val setHours :
hours:float ->
?minutes:float ->
?seconds:float ->
?milliseconds:float ->
t ->
floatreasonml
let setHours:
hours:float =>
?minutes:float =>
?seconds:float =>
?milliseconds:float =>
t =>
float;ocaml
val setMilliseconds : milliseconds:float -> t -> floatreasonml
let setMilliseconds: milliseconds:float => t => float;ocaml
val setMinutes :
minutes:float ->
?seconds:float ->
?milliseconds:float ->
t ->
floatreasonml
let setMinutes:
minutes:float =>
?seconds:float =>
?milliseconds:float =>
t =>
float;ocaml
val setMonth : month:float -> ?date:float -> t -> floatreasonml
let setMonth: month:float => ?date:float => t => float;ocaml
val setSeconds : seconds:float -> ?milliseconds:float -> t -> floatreasonml
let setSeconds: seconds:float => ?milliseconds:float => t => float;ocaml
val setTime : time:float -> t -> floatreasonml
let setTime: time:float => t => float;ocaml
val setUTCDate : date:float -> t -> floatreasonml
let setUTCDate: date:float => t => float;ocaml
val setUTCFullYear : year:float -> ?month:float -> ?date:float -> t -> floatreasonml
let setUTCFullYear: year:float => ?month:float => ?date:float => t => float;ocaml
val setUTCHours :
hours:float ->
?minutes:float ->
?seconds:float ->
?milliseconds:float ->
t ->
floatreasonml
let setUTCHours:
hours:float =>
?minutes:float =>
?seconds:float =>
?milliseconds:float =>
t =>
float;ocaml
val setUTCMilliseconds : milliseconds:float -> t -> floatreasonml
let setUTCMilliseconds: milliseconds:float => t => float;ocaml
val setUTCMinutes :
minutes:float ->
?seconds:float ->
?milliseconds:float ->
t ->
floatreasonml
let setUTCMinutes:
minutes:float =>
?seconds:float =>
?milliseconds:float =>
t =>
float;ocaml
val setUTCMonth : month:float -> ?date:float -> t -> floatreasonml
let setUTCMonth: month:float => ?date:float => t => float;ocaml
val setUTCSeconds : seconds:float -> ?milliseconds:float -> t -> floatreasonml
let setUTCSeconds: seconds:float => ?milliseconds:float => t => float;ocaml
val setUTCTime : time:float -> t -> floatreasonml
let setUTCTime: time:float => t => float;ocaml
val toDateString : t -> stringreasonml
let toDateString: t => string;ocaml
val toISOString : t -> stringreasonml
let toISOString: t => string;ocaml
val toJSON : t -> string optionreasonml
let toJSON: t => option(string);ocaml
val toJSONUnsafe : t -> stringreasonml
let toJSONUnsafe: t => string;ocaml
val toLocaleDateString : t -> stringreasonml
let toLocaleDateString: t => string;ocaml
val toLocaleString : t -> stringreasonml
let toLocaleString: t => string;ocaml
val toLocaleTimeString : t -> stringreasonml
let toLocaleTimeString: t => string;ocaml
val toString : t -> stringreasonml
let toString: t => string;ocaml
val toTimeString : t -> stringreasonml
let toTimeString: t => string;ocaml
val toUTCString : t -> stringreasonml
let toUTCString: t => string;