mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-19 05:33:44 +01:00
PaymentProtocolTool: use TimeUtils.dateTimeFormat()
to dump expiry time
This commit is contained in:
parent
0e871e9af4
commit
2cf4f17458
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package org.bitcoinj.tools;
|
package org.bitcoinj.tools;
|
||||||
|
|
||||||
|
import org.bitcoinj.base.internal.TimeUtils;
|
||||||
import org.bitcoinj.crypto.TrustStoreLoader;
|
import org.bitcoinj.crypto.TrustStoreLoader;
|
||||||
import org.bitcoinj.protocols.payments.PaymentProtocol;
|
import org.bitcoinj.protocols.payments.PaymentProtocol;
|
||||||
import org.bitcoinj.protocols.payments.PaymentProtocolException;
|
import org.bitcoinj.protocols.payments.PaymentProtocolException;
|
||||||
@ -31,6 +32,7 @@ import java.net.URI;
|
|||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.security.KeyStoreException;
|
import java.security.KeyStoreException;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
|
import java.time.Instant;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
@ -78,7 +80,7 @@ public class PaymentProtocolTool {
|
|||||||
output.append(format("Signed by: %s%nIdentity verified by: %s%n", pki.displayName, pki.rootAuthorityName));
|
output.append(format("Signed by: %s%nIdentity verified by: %s%n", pki.displayName, pki.rootAuthorityName));
|
||||||
}
|
}
|
||||||
if (session.getPaymentDetails().hasExpires()) {
|
if (session.getPaymentDetails().hasExpires()) {
|
||||||
output.append(format("Expires: %s%n", new Date(session.getPaymentDetails().getExpires() * 1000)));
|
output.append(format("Expires: %s%n", TimeUtils.dateTimeFormat(Instant.ofEpochSecond(session.getPaymentDetails().getExpires()))));
|
||||||
}
|
}
|
||||||
if (session.getMemo() != null) {
|
if (session.getMemo() != null) {
|
||||||
output.append(format("Memo: %s%n", session.getMemo()));
|
output.append(format("Memo: %s%n", session.getMemo()));
|
||||||
|
Loading…
Reference in New Issue
Block a user