module Time_Zone:sig..end
You can change the current time zone in your program by side effect.
type t =
| |
UTC |
(* | Greenwich Meridian Time | *) |
| |
Local |
(* | Local Time | *) |
| |
UTC_Plus of |
(* | Another time zone specified from UTC | *) |
val current : unit -> tUTC before any change.val change : t -> unitInvalid_argument if the specified time zone is UTC_Plus x with
x < -12 or x > 11val gap : t -> t -> intgap UTC (UTC_Plus 5) returns 5 and, at Paris in summer,
gap Local UTC returns -2.val from_gmt : unit -> intfrom_gmt () is equivalent to gap UTC (current ()).val to_gmt : unit -> intto_gmt () is equivalent to gap (current ()) UTC.val is_dst : unit -> boolis_dst () checks if daylight saving time is in effect.
Only relevant in local time.
Returns alway false in another time zone.val hour_of_dst : unit -> inthour_of_dst () returns 1 if is_dst () and 0 otherwise.val on : ('a -> 'b) -> t -> 'a -> 'bon f tz x changes the time zone to tz, then computes f x, and
finally reset the time zone to the initial one and returns the result of
the computation.