First finished implementation of XMP dates

This commit is contained in:
John Whitington
2019-06-29 14:04:27 +01:00
parent 650d634e8a
commit 872491f60e
3 changed files with 38 additions and 13 deletions

View File

@@ -82,8 +82,10 @@ let strftime_pairs =
"%p", strf_p; "%S", strf_S; "%T", strf_T; "%u", strf_u;
"%w", strf_w; "%Y", strf_Y; "%%", strf_percent]
let strftime text =
let time = Unix.localtime (Unix.gettimeofday ()) in
let strftime ?time text =
let time =
match time with None -> Unix.localtime (Unix.gettimeofday ()) | Some t -> t
in
let text = ref text in
iter
(fun (search, replace_fun) ->