From 977e5101e6c5e943d5ccec74856e97809a1034f4 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 29 Apr 2020 00:53:10 +0200 Subject: [PATCH] Fixed that due to time zone short after midnight calculated day may have been e.g. 30 days + 1 hour -> bank asked for TAN --- fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt b/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt index 6a12e998..c1321958 100644 --- a/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt +++ b/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt @@ -186,7 +186,8 @@ open class FinTsClient @JvmOverloads constructor( open fun tryGetTransactionsOfLast90DaysWithoutTan(bank: BankData, customer: CustomerData, account: AccountData, hasRetrievedTransactionsWithTanJustBefore: Boolean): GetTransactionsResponse { - val ninetyDaysAgo = Date(Date().time - NinetyDaysAgoMilliseconds) + val now = Date() + val ninetyDaysAgo = Date(now.time - NinetyDaysAgoMilliseconds - now.timezoneOffset * 60 * 1000) // map to UTC val response = getTransactions(GetTransactionsParameter(account.supportsRetrievingBalance, ninetyDaysAgo), bank, customer, account)