fix time format

This commit is contained in:
Serhii 2023-02-24 16:37:37 +02:00
parent efcfd625ec
commit 832ff62044
2 changed files with 4 additions and 4 deletions

View file

@ -69,10 +69,10 @@ class HavenTransactionInfo extends TransactionInfo {
: '~${(unlockTime - height) * 2} minutes';
}
var locked = DateTime.fromMillisecondsSinceEpoch(unlockTime).compareTo(DateTime.now());
var locked = DateTime.fromMicrosecondsSinceEpoch(unlockTime).compareTo(DateTime.now());
final DateFormat formatter = DateFormat('yyyy-MM-dd HH:mm:ss');
final String formattedUnlockTime =
formatter.format(DateTime.fromMillisecondsSinceEpoch(unlockTime));
formatter.format(DateTime.fromMicrosecondsSinceEpoch(unlockTime));
return locked >= 0 ? '$formattedUnlockTime' : null;
}

View file

@ -73,10 +73,10 @@ class MoneroTransactionInfo extends TransactionInfo {
: '~${(unlockTime - height) * 2} minutes';
}
var locked = DateTime.fromMillisecondsSinceEpoch(unlockTime).compareTo(DateTime.now());
var locked = DateTime.fromMicrosecondsSinceEpoch(unlockTime).compareTo(DateTime.now());
final DateFormat formatter = DateFormat('yyyy-MM-dd HH:mm:ss');
final String formattedUnlockTime =
formatter.format(DateTime.fromMillisecondsSinceEpoch(unlockTime));
formatter.format(DateTime.fromMicrosecondsSinceEpoch(unlockTime));
return locked >= 0 ? '$formattedUnlockTime' : null;
}