Module JavaTimeZone

module JavaTimeZone: sig .. end
Utility functions for Java time zones.

Instance creation

type t = java'util'TimeZone java_instance
The type of time zones.
val make : JavaString.t -> t
Returns a new java.util.TimeZone instance, corresponding to the passed identifier.
val get_available_ids : unit -> JavaString.t list
Returns the list of all time zone identifiers.
val get_default : unit -> t
Returns the default time zone.
val set_default : t -> unit
set_default tz changes the default time zone to tz if not null. Otherwise, the default time zone is reset to its original value (at VM start).


val get_display_name : t -> JavaString.t
Returns the name for the passed time zone, as a long string; see getDisplayName(...).
val get_id : t -> JavaString.t
Returns the identifier for the passed time zone; see getID(...).

Null value

val null : t
The null value.
val is_null : t -> bool
is_null obj returns true iff obj is equal to null.
val is_not_null : t -> bool
is_not_null obj returns false iff obj is equal to null.


val wrap : t -> t option
wrap obj wraps the reference obj into an option type:
  • Some x if obj is not null;
  • None if obj is null.

val unwrap : t option -> t
unwrap obj unwraps the option obj into a bare reference:
  • Some x is mapped to x;
  • None is mapped to null.