Seems like since opam 112 the function to_sec_string has changed its declaration and now includes the time zone https://ocaml.janestreet.com/ocaml-core/112.17/doc/core.112.17.00/_build/lib/time/index.html#/val:to_sec_string
So the call should be like:
Time.to_sec_string time Core.Zone.local ^ " -- " ^ message