emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] master 6cfda69 1/2: Add support for dealing with decod


From: Paul Eggert
Subject: Re: [Emacs-diffs] master 6cfda69 1/2: Add support for dealing with decoded time structures
Date: Wed, 31 Jul 2019 19:38:59 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

+(defun date-days-in-month (year month)
+  "The number of days in MONTH in YEAR."
+  (if (= month 2)
+      (if (date-leap-year-p year)
+          29
+        28)
+    (if (memq month '(1 3 5 7 8 10 12))
+        31
+      30)))

Doesn't this already exist as the Gregorian calendar-last-day-of-month
in calendar.el?

Yes, apparently.  (I didn't know about it.)

The two functions are not equivalent, as date-days-in-month uses astronomical year numbering, whereas calendar-last-day-of-month uses traditional year numbering, with no year zero.



reply via email to

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