Re: Adding Months to a date in assembly language



On Jun 26, 7:25 pm, "cr88192" <cr88...@xxxxxxxxxxxxxxxxxx> wrote:

how about, we use what could be called a "mean month", which could be
defined as 30.4375 days.

Because that produces results that are difficult to predict.
Such inaccuracies are really evident when trying to compute the number
of months between two dates (a function I'll probably post in the
future).



or, 730.5 hours, 43830 minutes, or 2629800 seconds.

in this way, we uniformly move one 'month' in the future, wherever the exact
date happens to be

The problem is that if you add one month do a date in January and get
March, people will question the result. And some algorithms will break
if this happens.

Clearly, adding a month to a date is a somewhat ambiguous operation
and you *have* to define what it means to add a month to a date. My
particular definition that I use (and this is by no means universal)
requires that the month digit never increase to the next month because
of issues involving the number of days in the intervening months. That
is, 1 month plus some date should always return the next calendar
month, even if the day values have to be truncated somewhat.

Other definitions are certainly possible (and certainly do exist).
hLater,
Randy Hyde



.