Reports with Month-end rather that Month-start

Mark Hedges mark.hedges at weirdvibe.com
Tue Sep 5 13:04:53 EDT 2017


Not sure about what to do in GnuCash, but the logic is simple to code with
a good date/time library to work with.

In Perl, for example, you'd do something like:

my $dt = DateTime->new( year => $year, month => $month, day => 1 )
    ->add( months => 1 )
    ->subtract( days => 1 )
    ;
say $dt->ymd('-');
# or
say $some_datetime_formatter->format_date($dt);

Pretty sure this will get the right answer every time.  Other people
smarter than me have usually worked out how to do neat things like this in
handy libraries, in whatever language.

HTH.
Mark



On Sep 5, 2017 8:03 AM, "David T. via gnucash-user" <
gnucash-user at gnucash.org> wrote:

> Ken,
>
> I don’t know where in the code base you want to look—but I will note that
> “the last day of the month” is more difficult to calculate than “the first
> day of the month.” The first day is always number 1; the last day varies
> month to month. I know some software packages make use of a conceptual
> "zero day of a month” to equate to the day before the first, but I do not
> know whether that convention applies in the GnuCash/Scheme. Not being a
> GnuCash programmer, I’ll let someone else with more experience weigh in.
>
> David
>
> > On Sep 5, 2017, at 7:47 PM, km22 <km22 at gmx.com> wrote:
> >
> > Hi Gnucash community,
> >
> > I want to start editing -- and eventually creating -- my own reports and
> > figures.  I think one place for me to start learning is by playing with
> > some existing report settings -- such as the report date functionality.
> > Currently when I run a report with a "monthly" period I get the 1st day
> > of each month.  How could I edit the report settings so I get the last
> > day of each month instead?  (I am a Windows 7 user if that makes a
> > difference on where to find/edit files.)
> >
> > Thanks,
> >
> > Ken
> >
> >
> >
> > _______________________________________________
> > gnucash-user mailing list
> > gnucash-user at gnucash.org
> > https://lists.gnucash.org/mailman/listinfo/gnucash-user
> > -----
> > Please remember to CC this list on all your replies.
> > You can do this by using Reply-To-List or Reply-All.
>
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.


More information about the gnucash-user mailing list