diff --git a/libgnucash/engine/Transaction.c b/libgnucash/engine/Transaction.c index c838c57639..91bead2cbd 100644 --- a/libgnucash/engine/Transaction.c +++ b/libgnucash/engine/Transaction.c @@ -2402,6 +2402,12 @@ xaccTransRetDatePostedTS (const Transaction *trans) return trans ? trans->date_posted : ts; } +time64 +xaccTransRetDatePosted (const Transaction *trans) +{ + return trans ? trans->date_posted.tv_sec : 0; +} + GDate xaccTransGetDatePostedGDate (const Transaction *trans) { @@ -2445,6 +2451,12 @@ xaccTransRetDateEnteredTS (const Transaction *trans) return trans ? trans->date_entered : ts; } +time64 +xaccTransRetDateEntered (const Transaction *trans) +{ + return trans ? trans->date_entered.tv_sec : 0; +} + void xaccTransGetDateDueTS (const Transaction *trans, Timespec *ts) { diff --git a/libgnucash/engine/Transaction.h b/libgnucash/engine/Transaction.h index 5414bd9055..8492857893 100644 --- a/libgnucash/engine/Transaction.h +++ b/libgnucash/engine/Transaction.h @@ -656,6 +656,7 @@ void xaccTransGetDatePostedTS (const Transaction *trans, Timespec *ts); having different function names, GetDate and GetDatePosted refer to the same single date.)*/ Timespec xaccTransRetDatePostedTS (const Transaction *trans); +time64 xaccTransRetDatePosted (const Transaction *trans); /** Retrieve the posted date of the transaction. The posted date is the date when this transaction was posted at the bank. */ GDate xaccTransGetDatePostedGDate (const Transaction *trans); @@ -671,6 +672,7 @@ void xaccTransGetDateEnteredTS (const Transaction *trans, Timespec *ts) /** Retrieve the date of when the transaction was entered. The entered * date is the date when the register entry was made.*/ Timespec xaccTransRetDateEnteredTS (const Transaction *trans); +time64 xaccTransRetDateEntered (const Transaction *trans); /** Dates and txn-type for A/R and A/P "invoice" postings */ Timespec xaccTransRetDateDueTS (const Transaction *trans); diff --git a/libgnucash/engine/gnc-pricedb.c b/libgnucash/engine/gnc-pricedb.c index 41088d0658..d550f24907 100644 --- a/libgnucash/engine/gnc-pricedb.c +++ b/libgnucash/engine/gnc-pricedb.c @@ -591,6 +591,13 @@ gnc_price_get_commodity(const GNCPrice *p) return p->commodity; } +time64 +gnc_price_get_time64(const GNCPrice *p) +{ + if (!p) return 0; + return p->tmspec.tv_sec; +} + Timespec gnc_price_get_time(const GNCPrice *p) { diff --git a/libgnucash/engine/gnc-pricedb.h b/libgnucash/engine/gnc-pricedb.h index 671c87ea2e..f2117f81e7 100644 --- a/libgnucash/engine/gnc-pricedb.h +++ b/libgnucash/engine/gnc-pricedb.h @@ -257,6 +257,7 @@ gnc_commodity * gnc_price_get_commodity(const GNCPrice *p); /*@ dependent @*/ gnc_commodity * gnc_price_get_currency(const GNCPrice *p); Timespec gnc_price_get_time(const GNCPrice *p); +time64 gnc_price_get_time64(const GNCPrice *p); PriceSource gnc_price_get_source(const GNCPrice *p); const char * gnc_price_get_source_string(const GNCPrice *p); const char * gnc_price_get_typestr(const GNCPrice *p);