1 (** Wrapper around Perl [Date::Format] class.
3 * Copyright (C) 2003 Merjis Ltd.
5 * $Id: pl_Date_Format.ml,v 1.1 2003-11-19 16:28:23 rich Exp $
10 let _ = eval "use Date::Format qw()"
13 call_class_method_void "Date::Format" "language" [sv_of_string lang]
15 (* This is just provided for your convenience so you can pass the resulting
16 * list of SVs directly to the second argument of {!Pl_Date_Format.strftime}.
19 call_array ~fn:"localtime" []
21 let time2str ?zone templ time =
23 [sv_of_string templ; sv_of_float time] @
26 | Some zone -> [sv_of_string zone] in
27 string_of_sv (call ~fn:"Date::Format::time2str" args)
29 let strftime ?zone templ time =
31 (sv_of_string templ :: time) @
34 | Some zone -> [sv_of_string zone] in
35 string_of_sv (call ~fn:"Date::Format::strftime" args)
37 let ctime ?zone time =
42 | Some zone -> [sv_of_string zone] in
43 string_of_sv (call ~fn:"Date::Format::ctime" args)
45 let asctime ?zone time =
50 | Some zone -> [sv_of_string zone] in
51 string_of_sv (call ~fn:"Date::Format::asctime" args)