In the old version of the Core library, the to_sec_string function had the following interface:
(** [to_sec_string t] Same as to_string, but without milliseconds *) val to_sec_string : t -> string
At some point in time, they changed their interface, and now it
(** Same as [to_string_abs], but without milliseconds *) val to_sec_string : t -> zone:Zone.t -> string
This means that now it is a function with two parameters. The first is still a value of type Time.t , and the second is a tagged argument of type Zone.t , which indicates the time zone. The labeled parameter, unlike the usual positional parameter, can be passed to the function in an arbitrary position, so you do not need to remember the order of the arguments. A typical call would look like this:
let s = Time.to_sec_string time ~zone:Time.Zone.local
where Time.Zone.local is the timezone object that represents your local timezone. Since this is a designated parameter, you can also call the function as follows:
let s = Time.to_sec_string ~zone:Time.Zone.local time
In addition, since both parameters are of different types here, OCaml can even guess who is who without using a label, so you can refuse positional arguments:
let s = Time.to_sec_string time Time.Zone.local
Finally, most types in Core have a to_string interface. Therefore, it would be easier to use it instead of to_sec_string . However, it has a slightly different and more detailed format:
Time.to_string time ^ " -- " ^ message