We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3c1f49f + f448b49 commit 82c5411Copy full SHA for 82c5411
timmy-timezones/lib/timmy_timezones.ml
@@ -39,6 +39,15 @@ let of_timere timere_tz : Timmy.Timezone.t =
39
40
let available_zones = Timedesc.Time_zone.available_time_zones
41
42
-let of_string tz_name =
43
- let tz = Timedesc.Time_zone.make tz_name in
44
- Option.map ~f:of_timere tz
+(** Normalize non-standard timezone names encountered in the wild to their IANA
+ name. *)
+let normalize_tz_name = function
45
+ | "Indiana/Indianapolis" -> "America/Indiana/Indianapolis"
46
+ | name -> name
47
+
48
+let of_string name =
49
+ match Timedesc.Time_zone.make @@ normalize_tz_name name with
50
+ | None ->
51
+ let () = Logs.err (fun m -> m "unknown timezone: %S" name) in
52
+ None
53
+ | Some tz -> Some (of_timere tz)
0 commit comments