Module CalendarLib.Time_Zone
type t
=
|
UTC
Greenwich Meridian Time
|
Local
Local Time
|
UTC_Plus of int
Another time zone specified from UTC
Type of a time zone.
val current : unit -> t
Return the current time zone. It is
UTC
before any change.
val change : t -> unit
Change the current time zone by another one. Raise
Invalid_argument
if the specified time zone isUTC_Plus x
withx < -12
orx > 11
val is_dst : unit -> bool
is_dst ()
checks if daylight saving time is in effect. Only relevant in local time. Returns alwayfalse
in another time zone.- since
- 1.09.4
val on : ('a -> 'b) -> t -> 'a -> 'b
on f tz x
changes the time zone totz
, then computesf x
, and finally reset the time zone to the initial one and returns the result of the computation.- since
- 2.0