gnucash-on-flatpak 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:59:21 EDT 2021


Updated	 via  https://github.com/Gnucash/gnucash-on-flatpak/commit/2dcf7837 (commit)
	from  https://github.com/Gnucash/gnucash-on-flatpak/commit/04bef894 (commit)



commit 2dcf78376b7fd54c8e37eddc54672aabda7904f5
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Sep 16 16:58:53 2021 -0700

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

diff --git a/modules/libofx.json b/modules/libofx.json
index 5b4eacf..2f27910 100644
--- a/modules/libofx.json
+++ b/modules/libofx.json
@@ -11,6 +11,10 @@
             "url": "https://github.com/libofx/libofx/archive/refs/tags/0.10.2.tar.gz",
             "sha256": "7418659d39f868847121e647220fc5daf60180236f230b3028e2699d317e549e"
         }
+        {
+            "type": "patch",
+            "path": "../patches/libofx-subtract-gmt-offset.patch"
+        }
     ],
     "modules": [
         {
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:
 modules/libofx.json                      |  4 ++++
 patches/libofx-subtract-gmt-offset.patch | 31 +++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 patches/libofx-subtract-gmt-offset.patch



More information about the gnucash-changes mailing list