From d937cf199687d4fc00ac2c2ad85ffb871b9551aa Mon Sep 17 00:00:00 2001 From: "D. Bohdan" Date: Sat, 13 Jun 2015 13:17:47 +0300 Subject: [PATCH 1/2] Fix Time.to_sec_string example As of Core version 112.17.00 Time.to_sec_string requires a time zone. --- code/guided-tour/main.topscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/guided-tour/main.topscript b/code/guided-tour/main.topscript index 73fd741..0c7d2ca 100644 --- a/code/guided-tour/main.topscript +++ b/code/guided-tour/main.topscript @@ -147,7 +147,7 @@ let log_entry maybe_time message = | Some x -> x | None -> Time.now () in - Time.to_sec_string time ^ " -- " ^ message + Time.to_sec_string time Time.Zone.local ^ " -- " ^ message ;; log_entry (Some Time.epoch) "A long long time ago";; log_entry None "Up to the minute";; From a1873fdcf40e3084faabd7a32489c4641c05fab9 Mon Sep 17 00:00:00 2001 From: "D. Bohdan" Date: Mon, 28 Aug 2023 13:41:27 +0000 Subject: [PATCH 2/2] fix `Time.to_sec_string` example again `Time.Zone.local` has been removed from the package `core`. The current version, 0.16.1, has a deprecation warning in its place. There is a platform-specific replacement in `core-unix`. To avoid requiring `core-unix`, let's change the time zone to UTC. --- code/guided-tour/main.topscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/guided-tour/main.topscript b/code/guided-tour/main.topscript index 0c7d2ca..600511e 100644 --- a/code/guided-tour/main.topscript +++ b/code/guided-tour/main.topscript @@ -147,7 +147,7 @@ let log_entry maybe_time message = | Some x -> x | None -> Time.now () in - Time.to_sec_string time Time.Zone.local ^ " -- " ^ message + Time.to_sec_string time ~zone:Time.Zone.utc ^ " -- " ^ message ;; log_entry (Some Time.epoch) "A long long time ago";; log_entry None "Up to the minute";;