mldonkey-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-commits] Changes to mldonkey/src/utils/lib/date.ml


From: mldonkey-commits
Subject: [Mldonkey-commits] Changes to mldonkey/src/utils/lib/date.ml
Date: Mon, 15 Aug 2005 16:22:51 -0400

Index: mldonkey/src/utils/lib/date.ml
diff -u mldonkey/src/utils/lib/date.ml:1.5 mldonkey/src/utils/lib/date.ml:1.6
--- mldonkey/src/utils/lib/date.ml:1.5  Sun May 29 23:26:01 2005
+++ mldonkey/src/utils/lib/date.ml      Mon Aug 15 20:22:50 2005
@@ -11,6 +11,7 @@
 | Space
 | Colon
 | Dot
+| Minus
 | Zone
   
 let months = [| "Jan"; "Feb"; "Mar"; "Apr"; "May"; "Jun";
@@ -30,12 +31,13 @@
       | Day -> Printf.sprintf "%s%02d" s tm.Unix.tm_mday
       | WeekDay  -> Printf.sprintf "%s%s" s (!day tm.Unix.tm_wday)
       | Month -> Printf.sprintf "%s%s" s (!month tm.Unix.tm_mon)
-      | MonthNumber -> Printf.sprintf "%s%d" s (tm.Unix.tm_mon)
+      | MonthNumber -> Printf.sprintf "%s%02d" s (tm.Unix.tm_mon+1)
       | Year -> Printf.sprintf "%s%04d" s (1900+tm.Unix.tm_year)
       | Comma -> s ^ ","
       | Space -> s ^ " "
       | Colon -> s ^ ":"
       | Dot -> s ^ "."
+      | Minus -> s ^ "-"
       | Zone -> s ^ "-0000" (* BUG: RFC 2822: Though "-0000" also indicates 
Universal Time, it is
          used to indicate that the time was generated on a system that may be
            in a local time zone other than Universal Time and therefore
@@ -54,6 +56,10 @@
 
 let simple date = 
   string_of_date [Hour;Colon;Minute;Colon;Second;Space; Space; WeekDay]
+    (Unix.localtime date)
+
+let reverse date = 
+  string_of_date [Year;MonthNumber;Day;Minus;Hour;Minute;Second]
     (Unix.localtime date)
   
 let mail_string date =




reply via email to

[Prev in Thread] Current Thread [Next in Thread]