From 5610fbb4b8acc770f3b8f06004ff348b12b7aa52 Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Tue, 5 Dec 2000 09:17:59 +0000 Subject: [PATCH] Merge from stable tree. Strip time portion off of default transaction date. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3240 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/SplitLedger.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/SplitLedger.c b/src/SplitLedger.c index c579cc3f7b..3acef92761 100644 --- a/src/SplitLedger.c +++ b/src/SplitLedger.c @@ -248,6 +248,23 @@ static void xaccSRSetTransVisible (SplitRegister *reg, /** implementations *******************************************************/ +static time_t +get_today_midnight (void) +{ + time_t present; + struct tm tm; + + present = time (NULL); + + tm = *localtime (&present); + + tm.tm_sec = 0; + tm.tm_min = 0; + tm.tm_hour = 0; + + return mktime (&tm); +} + /* The routines below create, access, and destroy the SRInfo structure * used by SplitLedger routines to store data for a particular register. * This is the only code that should access the user_data member of a @@ -265,7 +282,7 @@ xaccSRInitRegisterData(SplitRegister *reg) info->blank_split_guid = *xaccGUIDNULL (); info->pending_trans_guid = *xaccGUIDNULL (); - info->last_date_entered = time(NULL); + info->last_date_entered = get_today_midnight (); info->first_pass = TRUE; reg->user_data = info;