open Printf
+module CL = CalendarLib
+
(* Base colours. XXX Should be configurable somewhere. *)
let file_color = 0x20, 0x20, 0xff (* regular file *)
let dir_color = 0x80, 0x80, 0x20 (* directory *)
let t = Int64.to_float t in
let show_full_date () =
- let tm = localtime t in
- sprintf "<span color=\"#222222\" size=\"small\">%04d-%02d-%02d %02d:%02d:%02d</span>"
- (tm.tm_year + 1900) (tm.tm_mon + 1) tm.tm_mday
- tm.tm_hour tm.tm_min tm.tm_sec
+ let cal = CL.Calendar.from_unixfloat t in
+ let cal = CL.Calendar.convert cal CL.Time_Zone.UTC CL.Time_Zone.Local in
+ CL.Printer.Calendar.sprint
+ "<span color=\"#222222\" size=\"small\">%F %T</span>" cal
in
(* How long ago? *)