This is just code motion.
Unixqueue.clear esys g;
timer_group := None
-and string_of_time_t t =
- let tm = gmtime t in
- sprintf "%04d-%02d-%02d %02d:%02d:%02d UTC"
- (1900+tm.tm_year) (1+tm.tm_mon) tm.tm_mday
- tm.tm_hour tm.tm_min tm.tm_sec
-
and run_job job =
(* Increment JOBSERIAL. *)
let serial =
match f x with
| Some y -> y :: filter_map f xs
| None -> filter_map f xs
+
+let string_of_time_t ?(localtime = false) t =
+ let tm = (if localtime then Unix.localtime else gmtime) t in
+ sprintf "%04d-%02d-%02d %02d:%02d:%02d%s"
+ (1900+tm.tm_year) (1+tm.tm_mon) tm.tm_mday
+ tm.tm_hour tm.tm_min tm.tm_sec
+ (if localtime then "" else " UTC")
val filter_map : ('a -> 'b option) -> 'a list -> 'b list
(** Filter + map. *)
+
+val string_of_time_t : ?localtime:bool -> float -> string
+(** Convert string to time in ISO format. If [~localtime] is true
+ then it uses localtime, else UTC. *)