rm non-NBO Bin.t; rename time modules
This commit is contained in:
parent
4f473c003a
commit
d69b49a335
13 changed files with 306 additions and 359 deletions
|
|
@ -14,16 +14,17 @@ open Offline_impl
|
|||
|
||||
module Arg = struct
|
||||
include Arg
|
||||
open Time
|
||||
|
||||
(* in seconds *)
|
||||
let timestamp =
|
||||
let parser s =
|
||||
match int_of_string_opt s with
|
||||
| None -> Error "not an int"
|
||||
| Some n -> Ok (Time.Timestamp.of_s (Int64.of_int n))
|
||||
| Some n -> Ok (Timestamp.of_s (Int64.of_int n))
|
||||
in
|
||||
let pp fmt t =
|
||||
match Time.Timestamp.to_s t with
|
||||
match Timestamp.to_s t with
|
||||
| None -> Fmt.pf fmt "never"
|
||||
| Some s -> Fmt.pf fmt "%Ld" s
|
||||
in
|
||||
|
|
@ -34,11 +35,11 @@ module Arg = struct
|
|||
let parser s =
|
||||
match int_of_string_opt s with
|
||||
| None -> Error "not an int"
|
||||
| Some s -> Ok (Time.Relative.of_s (Int64.of_int s))
|
||||
| Some s -> Ok (TimeRelative.of_s (Int64.of_int s))
|
||||
in
|
||||
let pp fmt d =
|
||||
let t = Time.Timestamp.of_absolute Time.Absolute.(add zero d) in
|
||||
match Time.Timestamp.to_s t with
|
||||
let t = Timestamp.of_absolute TimeAbsolute.(add zero d) in
|
||||
match Timestamp.to_s t with
|
||||
| None -> Fmt.pf fmt "never"
|
||||
| Some s -> Fmt.pf fmt "%Ld" s
|
||||
in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue