diff options
Diffstat (limited to 'date.ml')
-rw-r--r-- | date.ml | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -95,12 +95,10 @@ module Make(C : CALCULABLE) = struct and time_regex = Str.regexp "[0-9]+-[0-9]+-[0-9]+T[0-9]+:[0-9]+:[0-9]" in if Str.string_match time_regex str 0 then Scanf.sscanf str "%d-%d-%dT%d:%d:%d" (fun year month day hour min sec -> - Num.( - let nhour = C.div (n hour) (n 24) - and nmin = C.div (n min) (n 1440) - and nsec = C.div (n sec) (n 86400) in - C.add (C.add (C.add (get_julian_day year month day) nhour) nmin) nsec - ) + let nhour = C.div (n hour) (n 24) + and nmin = C.div (n min) (n 1440) + and nsec = C.div (n sec) (n 86400) in + C.add (C.add (C.add (get_julian_day year month day) nhour) nmin) nsec ) else if Str.string_match date_regex str 0 then Scanf.sscanf str "%d-%d-%d" get_julian_day else ( |