Accounting standard for "one month ago"

Dave Peticolas peticola@krondo.com
Thu, 10 Aug 2000 20:52:56 -0700


Robert Graham Merkel writes:
> As previously reported, I'm adding a new type of option for relative
> dates.  I'd like to add a relative date for "one month ago".  My
> simplistic definition for "one month ago" on 
> m/d/yy is (m-1/d/yy) but this
> of course poses a slight problem on, say, the 31st of May.
> 
> What should we do here, or should I avoid the problem entirely and use
> "30 days ago" instead?

I'm not sure if there is a standard, but it seems reasonable
to want to be able to talk about something happening on the
'last day of the month' or whatever. One possibility would
be that

one month ago m/d/yy is m-1/X/yy

where X is the same number of days until the end of m-1 as
d was to the end of m.

OTOH, if you're on the 1st, or just close to the start of the month,
then you'd probably want to count from the first day, not the last.
Get's kind of complicated :)

dave