Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Fmlib_js.DateThe javascript date object
The javascript date object is the number of milliseconds passed from 1.1.1970 UTC. The date object has no time zone. Its value of milliseconds is always since 1.1.1970 UTC.
All access functions (except for value) like day, hours, ... etc. return the values valid in the timezone of your system. I.e. hours (of_value 0.) does not return 0 but the hour in the timezone of your system at 1.1.1970 UTC.
If you have a date object d and want the day, hour, ... in another timezone which has offset0 to UTC you can do the following:
let d0 =
add
((Float.of_int (zone_offset d - offset0)) *. 60000)
dThen day d0, hours d0, ... are the values in the desired timezone.
val now : unit -> tConstruct a new date object at the current time.
val value : t -> floatThe number of milliseconds passed since 1.1.1970 UTC.
val of_value : float -> tof_value millis Construct a new date object pointing to 1.1.1970 UTC + ms milliseconds.
val zone_offset : t -> intTimezone offset in minutes from UTC. Westward positive, eastward negative.
add ms date Add ms milliseconds to the current time and return the new date object.
val make : int -> int -> int -> int -> int -> int -> int -> tmake year month day hour minute second millis Make a date object for the current time zone.
val day : t -> intThe day of the week.
sunday .. saturday ~> 0 .. 6
val date : t -> intThe date in the month starting with 1.
val month : t -> intThe month (1-12)
val year : t -> intThe year.
val hours : t -> intThe hour (0-23).
val minutes : t -> intThe minute (0-59).
val seconds : t -> intThe second (0-59).
val milliseconds : t -> intThe the millisecond (0-999).