Wednesday, September 01, 2021

Re: Run a command on "last day of month"

Hi,

Adam Paulukanis wrote on Wed, Sep 01, 2021 at 04:39:54PM +0200:

> if today is the last day of the month, tomorrow will be 1st.

That is a non-portable assumption and a trap that many people seem
to fall into.

For example, in the shire calendar, 1 Afterlithe (~= July) is the
fourth day after 30 Forelithe (which always is the last day of
Forelithe ~= June) in some years, and the fifth day after in other
years, but never the first, second, or third. Similarly, 1 Afteryule
(~= January) is the third day after 30 Forejule (the last day in
Foreyule ~= December). That also implies that January 1 is *never*
the first day of the year, and that the last day of the last month
of a year is *never* the last day of that year.

Localization is an extremely hard and complex task. For that reason,
OpenBSD believes the C library is the wrong place to attempt to
provide such functionality. The same applies to general-purpose
command line tools like date(1), ls(1), and cron(8). The price to
pay in terms of complexity, and hence ultimately in bugs, would be
excessive.

Yours,
Ingo

No comments:

Post a Comment