-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutil_timeonly.mli
36 lines (28 loc) · 971 Bytes
/
util_timeonly.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(*
Conversion from/to RFC-3339 compatible time of the day of the form HH:MM:SS.
*)
type t = private {
hour : int;
min : int;
sec : float;
string : string;
}
val create : hour:int -> min:int -> sec:float -> t
val of_string : string -> t
val of_string_opt : string -> t option
val to_string : t -> string
val wrap : string -> t
val unwrap : t -> string
val of_float : float -> t
(* Interpret the input as a number of seconds since midnight on some day.
The result is guaranteed to be in the range 0:00:00.000-23:59:59.999
*)
val to_float : t -> float
(* Return the number of seconds since the beginning of the day. *)
val format : fmt:string -> t -> string
(* Format a time using Netdate.format. See documentation at URL below.
http://projects.camlcity.org\
/projects/dl/ocamlnet-3.2/doc/html-main/Netdate.html
Don't use this to format the date part, or you'll get 1970-01-01.
*)
val tests : (string * (unit -> bool)) list