gnucash-on-windows master: Bug 798267 - import from UP bank appearing the next day in the transaction list after import

John Ralls jralls at code.gnucash.org
Thu Sep 16 19:45:56 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash-on-windows/commit/f1ee4eee (commit)
	from  https://github.com/Gnucash/gnucash-on-windows/commit/62847d55 (commit)



commit f1ee4eeee8cbf13a267879ff3dc7184d4c9e0fa9
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Sep 16 16:45:44 2021 -0700

    Bug 798267 - import from UP bank appearing the next day in the transaction list after import

diff --git a/gnucash.modules b/gnucash.modules
index 6424bdf..0b0b30e 100644
--- a/gnucash.modules
+++ b/gnucash.modules
@@ -217,6 +217,7 @@
     <branch repo="sourceforge" module="libofx/libofx-0.10.2.tar.gz"
 	    version="0.10.2">
       <patch file="libofx1.10.2-win32-timegm.patch" strip="1"/>
+      <patch file="libofx-subtract-gmt-offset.patch" strip="1"/>
     </branch>
     <dependencies>
       <dep package="OpenSP"/>
diff --git a/patches/libofx-subtract-gmt-offset.patch b/patches/libofx-subtract-gmt-offset.patch
new file mode 100644
index 0000000..d6e8932
--- /dev/null
+++ b/patches/libofx-subtract-gmt-offset.patch
@@ -0,0 +1,31 @@
+From 86036241d35df6570a19f932f5486d4a27dc3f02 Mon Sep 17 00:00:00 2001
+From: John Ralls <jralls at ceridwen.us>
+Date: Thu, 16 Sep 2021 16:32:30 -0700
+Subject: [PATCH] Reverse the application of gmt offset seconds to struct
+ tm::tm_sec.
+
+A positive gmt offset means that UTC is that many seconds before the
+time indicated in struct tm so the gmt offset should be subtracted
+from tm_sec not added.
+
+Fixes https://bugs.gnucash.org/show_bug.cgi?id=798267.
+---
+ lib/ofx_utilities.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/ofx_utilities.cpp b/lib/ofx_utilities.cpp
+index ced5cf9..6c8aa1e 100644
+--- a/lib/ofx_utilities.cpp
++++ b/lib/ofx_utilities.cpp
+@@ -152,7 +152,7 @@ string AppendCharStringtostring(const SGMLApplication::CharString source, string
+     float ofx_gmt_offset = atof(offset_str.c_str());
+     std::time_t temptime = std::time(nullptr);
+     static const double secs_per_hour = 3600.0;
+-    time.tm_sec += static_cast<int>(ofx_gmt_offset * secs_per_hour);
++    time.tm_sec -= static_cast<int>(ofx_gmt_offset * secs_per_hour);
+     return timegm(&time);
+   }
+ 
+-- 
+2.30.1 (Apple Git-130)
+



Summary of changes:
 gnucash.modules                          |  1 +
 patches/libofx-subtract-gmt-offset.patch | 31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 patches/libofx-subtract-gmt-offset.patch



More information about the gnucash-changes mailing list