Return the end time as seconds since 1970, and don't adjust it
for timezone. In the main module the end time is compared against
the result of Unix.gettimeofday, which is also seconds since 1970,
so the comparison now works.
Tested with TZ=UTC-05, TZ=UTC and TZ=UTC+05.
NB: This has not been tested against ocaml-calendar 1.x, although
that version of calendar is obsolete and no one should be using it.
eprintf "end time: %s\n" (Printer.CalendarPrinter.to_string cal);
- (* Convert to a time_t, adjusting for the current timezone. *)
- fst (Unix.mktime (Calendar.to_unixtm cal))
+ (* Convert to a time_t. Note that we compare this against
+ * Unix.gettimeofday in the main module, so this must be returned as
+ * plain seconds from 1970 with no timezone adjustment. (RHBZ#637964)
+ *)
+ Calendar.to_unixfloat cal
eprintf "end time: %s\n" (Printer.CalendarPrinter.to_string cal);
- (* Convert to a time_t, adjusting for the current timezone. *)
- fst (Unix.mktime (Calendar.to_unixtm cal))
+ (* Convert to a time_t. Note that we compare this against
+ * Unix.gettimeofday in the main module, so this must be returned as
+ * plain seconds from 1970 with no timezone adjustment. (RHBZ#637964)
+ *)
+ Calendar.to_unixfloat cal