gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: make time and zone offset appear into


From: gnunet
Subject: [libeufin] branch master updated: make time and zone offset appear into pain001 date.
Date: Thu, 12 Mar 2020 14:46:00 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 0f6e798  make time and zone offset appear into pain001 date.
0f6e798 is described below

commit 0f6e798648f5d14cfc105e6959457504b393c1b1
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Mar 12 14:45:21 2020 +0100

    make time and zone offset appear into pain001 date.
---
 nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt 
b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
index d4e3b11..68a865d 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Main.kt
@@ -55,7 +55,11 @@ import java.lang.StringBuilder
 import java.security.interfaces.RSAPublicKey
 import java.text.DateFormat
 import java.text.SimpleDateFormat
+import java.time.Instant
 import java.time.LocalDate
+import java.time.ZoneId
+import java.time.ZonedDateTime
+import java.time.format.DateTimeFormatter
 import java.util.*
 import javax.crypto.EncryptedPrivateKeyInfo
 import javax.sql.rowset.serial.SerialBlob
@@ -178,7 +182,10 @@ fun createPain001document(pain001Entity: Pain001Entity): 
String {
                         val dateMillis = transaction {
                             pain001Entity.date
                         }
-                        text(DateTime(dateMillis).toString("Y-M-d"))
+                        val dateFormatter = 
DateTimeFormatter.ISO_OFFSET_DATE_TIME
+                        val instant = Instant.ofEpochSecond(dateMillis / 1000)
+                        val zoned = ZonedDateTime.ofInstant(instant, 
ZoneId.systemDefault())
+                        text(dateFormatter.format(zoned))
                     }
                     element("NbOfTxs") {
                         text("1")

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]