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")