From c50a64f2ee5c5ae79a73601047ff085164955608 Mon Sep 17 00:00:00 2001 From: dankito Date: Mon, 3 Aug 2020 22:14:42 +0200 Subject: [PATCH] Fixed that all years of dates were too small by 100 years --- .../dankito/banking/fints/transactions/mt940/Mt940Parser.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/transactions/mt940/Mt940Parser.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/transactions/mt940/Mt940Parser.kt index 8a7848f9..f56d8548 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/transactions/mt940/Mt940Parser.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/transactions/mt940/Mt940Parser.kt @@ -430,7 +430,7 @@ open class Mt940Parser : IMt940Parser { // this really simple date format on my own if (dateString.length == 6) { try { - var year = dateString.substring(0, 2).toInt() + 2000 + var year = dateString.substring(0, 2).toInt() val month = dateString.substring(2, 4).toInt() val day = dateString.substring(4, 6).toInt() @@ -438,7 +438,7 @@ open class Mt940Parser : IMt940Parser { year -= 100 } - return Date(year, month, day) // java.util.Date years start at 1900 at month at 0 not at 1 + return Date(year + 2000, month, day) // java.util.Date years start at 1900 at month at 0 not at 1 } catch (e: Exception) { log.error(e) { "Could not parse dateString '$dateString'" } }