diff --git a/libgnucash/engine/gnc-option-date.cpp b/libgnucash/engine/gnc-option-date.cpp index ee3c72b0d7..fdf954f9a6 100644 --- a/libgnucash/engine/gnc-option-date.cpp +++ b/libgnucash/engine/gnc-option-date.cpp @@ -527,7 +527,7 @@ gnc_relative_date_to_time64(RelativeDatePeriod period) { auto delta = (now.tm_mon >= acct_per.tm_mon ? ( now.tm_mon - acct_per.tm_mon) % 3 : - 3 - ((acct_per.tm_mon - now.tm_mon) % 3)); + (3 - acct_per.tm_mon - now.tm_mon) % 3); now.tm_mon = now.tm_mon - delta; } [[fallthrough]];