r17736 - gnucash/branches/2.2/src/quotes - [r17680] Bug #339433: FIx price quote dates off by one day

Christian Stimming cstim at cvs.gnucash.org
Thu Nov 27 06:18:07 EST 2008


Author: cstim
Date: 2008-11-27 06:18:06 -0500 (Thu, 27 Nov 2008)
New Revision: 17736
Trac: http://svn.gnucash.org/trac/changeset/17736

Modified:
   gnucash/branches/2.2/src/quotes/gnc-fq-helper.in
Log:
[r17680] Bug #339433: FIx price quote dates off by one day

This bug is related to all the rest of the date-time issues, but has an
additional twist because of finance-quote.

Somewhere between the fq-helper and the price db, gnucash rolls the quote
through timespecCanonicalDayTime(), wherein it first runs localtime_r(), to
produce, presumably, "2008-11-03 19:00:00" for my Eastern US location. Having
now screwed up the date, gnucash runs gnc_tm_set_day_middle() on it to enter
the price in the pricedb as of noon on the wrong date.

Patch by David Reiser.

Modified: gnucash/branches/2.2/src/quotes/gnc-fq-helper.in
===================================================================
--- gnucash/branches/2.2/src/quotes/gnc-fq-helper.in	2008-11-27 11:17:57 UTC (rev 17735)
+++ gnucash/branches/2.2/src/quotes/gnc-fq-helper.in	2008-11-27 11:18:06 UTC (rev 17736)
@@ -210,7 +210,11 @@
   }
 
   my $parsestr = $datestr;
-  if($timestr) {
+  if(!$timestr) {
+    #fix date handling for quotes with no time. 
+    #Keeps gnucash from getting date wrong in west longitude places.
+    $parsestr .= " 12:00:00"
+  } else {
     $parsestr .= " $timestr";
   }
 



More information about the gnucash-changes mailing list