When I import a SWIFT MT940 file, the dates of the transactions are imported in a day too early in GnuCash. See the attached SWIFT MT940 file as test. The date of the transaction is 27/1, but after import in GnuCash the date is 26/1 in GnuCash.
Created attachment 373790 [details] SWIFT MT940 test file to import
See also bug 797848.
As I was reading bug 137017, I thought that it might be useful to say that my timezone is CEST.
As suggested in bug 137017 comment 43, I ran GnuCash as follows: $ TZ=ADT+3 gnucash And then I tried the import again. This resulted in a correctly imported date. So, I think that this issue is more time zone related than aqbanking related.
It is a timezone problem but it's AQBanking's time zone problem: The function GWEN_Date_ToTimeT uses the current (as in today's) offset to compute the timestamp of midnight local time on the date to GMT instead of the offset that applies on the actual date. That means that a date when Summer Time (aka Daylight Savings Time in the USA) isn't in effect gets a time stamp an hour early if it's imported when Summer Time is in effect and an hour late in the other case. By setting your TZ to a fixed timezone you worked around the error and got the wrong date. I've worked around the problem by retrieving the day, month, and year from the date and using a GnuCash function to convert it to a timestamp.
Thanks John!