mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix posted-date scrub incrementing the day in central pacific timezones.
This commit is contained in:
parent
1c8c53a861
commit
aeb2e65ff1
@ -2424,7 +2424,20 @@ xaccTransGetDatePostedGDate (const Transaction *trans)
|
|||||||
if (G_VALUE_HOLDS_BOXED (&v))
|
if (G_VALUE_HOLDS_BOXED (&v))
|
||||||
result = *(GDate*)g_value_get_boxed (&v);
|
result = *(GDate*)g_value_get_boxed (&v);
|
||||||
if (! g_date_valid (&result))
|
if (! g_date_valid (&result))
|
||||||
result = timespec_to_gdate(xaccTransRetDatePostedTS(trans));
|
{
|
||||||
|
/* Well, this txn doesn't have a GDate saved in a
|
||||||
|
* slot. Avoid getting the date in the local TZ by
|
||||||
|
* converting to UTC before generating the
|
||||||
|
* date. (timespec_to_gdate doesn't do this so don't use
|
||||||
|
* it.
|
||||||
|
*/
|
||||||
|
time64 time = xaccTransGetDate(trans);
|
||||||
|
struct tm *stm = gnc_gmtime(&time);
|
||||||
|
g_date_set_dmy(&result, stm->tm_mday,
|
||||||
|
(GDateMonth)(stm->tm_mon + 1),
|
||||||
|
stm->tm_year + 1900);
|
||||||
|
free(stm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user