unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Lars Ingebrigtsen <larsi@gnus.org>,
	"Basil L. Contovounesios" <contovob@tcd.ie>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <02976867-d320-51aa-c4cb-864831a5ac35@cs.ucla.edu> (raw)
In-Reply-To: <87mugund5x.fsf@mouse.gnus.org>

>>> +(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	other threads:[~2019-08-01  2:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190729122247.28663.99759@vcs0.savannah.gnu.org>
     [not found] ` <20190729122257.00600207F5@vcs0.savannah.gnu.org>
2019-07-30  5:19   ` master 6cfda69 1/2: Add support for dealing with decoded time structures Glenn Morris
2019-07-30 10:01     ` Lars Ingebrigtsen
2019-07-31 20:31   ` [Emacs-diffs] " Basil L. Contovounesios
2019-07-31 20:48     ` Lars Ingebrigtsen
2019-08-01  2:38       ` Paul Eggert [this message]
2019-08-01  9:35         ` Basil L. Contovounesios
2019-08-01 11:21           ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=02976867-d320-51aa-c4cb-864831a5ac35@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=contovob@tcd.ie \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).