diff --git a/jpo-ode-common/src/main/java/us/dot/its/jpo/ode/util/DateTimeUtils.java b/jpo-ode-common/src/main/java/us/dot/its/jpo/ode/util/DateTimeUtils.java index 40a1ab62f..7dea6140e 100644 --- a/jpo-ode-common/src/main/java/us/dot/its/jpo/ode/util/DateTimeUtils.java +++ b/jpo-ode-common/src/main/java/us/dot/its/jpo/ode/util/DateTimeUtils.java @@ -29,7 +29,7 @@ private DateTimeUtils() { } public static String now() { - return nowZDT().format(DateTimeFormatter.ISO_INSTANT); + return nowZDT().format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")); } public static ZonedDateTime nowZDT() { @@ -37,7 +37,7 @@ public static ZonedDateTime nowZDT() { } public static String isoDateTime(ZonedDateTime zonedDateTime) { - return zonedDateTime.format(DateTimeFormatter.ISO_INSTANT); + return zonedDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")); } public static ZonedDateTime diff --git a/jpo-ode-common/src/test/java/us/dot/its/jpo/ode/util/DateTimeUtilsTest.java b/jpo-ode-common/src/test/java/us/dot/its/jpo/ode/util/DateTimeUtilsTest.java index 079048d21..fa8e4bca4 100644 --- a/jpo-ode-common/src/test/java/us/dot/its/jpo/ode/util/DateTimeUtilsTest.java +++ b/jpo-ode-common/src/test/java/us/dot/its/jpo/ode/util/DateTimeUtilsTest.java @@ -23,7 +23,6 @@ import org.junit.jupiter.api.Test; import junit.framework.TestCase; -import us.dot.its.jpo.ode.util.DateTimeUtils; public class DateTimeUtilsTest extends TestCase { @@ -38,7 +37,7 @@ public void testIsoDateTime() throws ParseException { expectedDate.getHour(), expectedDate.getMinute(), expectedDate.getSecond(), - expectedDate.getNano()/1000000).format(DateTimeFormatter.ISO_INSTANT); + expectedDate.getNano()/1000000).format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")); assertEquals(sExpectedDate.substring(0, 18), sdate.substring(0, 18)); ZonedDateTime date2 = DateTimeUtils.isoDateTime("2015-11-30T16:06:15.679Z"); diff --git a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/bsm/BsmReceiver.java b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/bsm/BsmReceiver.java index 6088c0c28..437bff4d7 100644 --- a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/bsm/BsmReceiver.java +++ b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/bsm/BsmReceiver.java @@ -81,7 +81,7 @@ public void run() { // Set BSM Metadata values that can be assumed from the UDP endpoint ZonedDateTime utc = ZonedDateTime.now(ZoneOffset.UTC); - String timestamp = utc.format(DateTimeFormatter.ISO_INSTANT); + String timestamp = utc.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")); bsmMetadata.setOdeReceivedAt(timestamp); ReceivedMessageDetails receivedMessageDetails = new ReceivedMessageDetails(); diff --git a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/map/MapReceiver.java b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/map/MapReceiver.java index c39efc181..321e628d4 100644 --- a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/map/MapReceiver.java +++ b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/map/MapReceiver.java @@ -77,7 +77,7 @@ public void run() { // Add header data for the decoding process ZonedDateTime utc = ZonedDateTime.now(ZoneOffset.UTC); - String timestamp = utc.format(DateTimeFormatter.ISO_INSTANT); + String timestamp = utc.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")); mapMetadata.setOdeReceivedAt(timestamp); mapMetadata.setOriginIp(senderIp); diff --git a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/psm/PsmReceiver.java b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/psm/PsmReceiver.java index ec490135d..66b570965 100644 --- a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/psm/PsmReceiver.java +++ b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/psm/PsmReceiver.java @@ -77,7 +77,7 @@ public void run() { // Add header data for the decoding process ZonedDateTime utc = ZonedDateTime.now(ZoneOffset.UTC); - String timestamp = utc.format(DateTimeFormatter.ISO_INSTANT); + String timestamp = utc.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")); psmMetadata.setOdeReceivedAt(timestamp); psmMetadata.setOriginIp(senderIp); diff --git a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/spat/SpatReceiver.java b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/spat/SpatReceiver.java index 1da03f693..c18a5aa77 100644 --- a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/spat/SpatReceiver.java +++ b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/spat/SpatReceiver.java @@ -77,7 +77,7 @@ public void run() { // Add header data for the decoding process ZonedDateTime utc = ZonedDateTime.now(ZoneOffset.UTC); - String timestamp = utc.format(DateTimeFormatter.ISO_INSTANT); + String timestamp = utc.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")); spatMetadata.setOdeReceivedAt(timestamp); spatMetadata.setOriginIp(senderIp); diff --git a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/srm/SrmReceiver.java b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/srm/SrmReceiver.java index 733569a69..056628b67 100644 --- a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/srm/SrmReceiver.java +++ b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/srm/SrmReceiver.java @@ -77,7 +77,7 @@ public void run() { // Add header data for the decoding process ZonedDateTime utc = ZonedDateTime.now(ZoneOffset.UTC); - String timestamp = utc.format(DateTimeFormatter.ISO_INSTANT); + String timestamp = utc.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")); srmMetadata.setOdeReceivedAt(timestamp); srmMetadata.setOriginIp(senderIp); diff --git a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/ssm/SsmReceiver.java b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/ssm/SsmReceiver.java index dd700ebd7..e4f7a6221 100644 --- a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/ssm/SsmReceiver.java +++ b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/ssm/SsmReceiver.java @@ -77,7 +77,7 @@ public void run() { // Add header data for the decoding process ZonedDateTime utc = ZonedDateTime.now(ZoneOffset.UTC); - String timestamp = utc.format(DateTimeFormatter.ISO_INSTANT); + String timestamp = utc.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")); ssmMetadata.setOdeReceivedAt(timestamp); ssmMetadata.setOriginIp(senderIp); diff --git a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/tim/TimReceiver.java b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/tim/TimReceiver.java index a6b190336..ea5486aad 100644 --- a/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/tim/TimReceiver.java +++ b/jpo-ode-svcs/src/main/java/us/dot/its/jpo/ode/udp/tim/TimReceiver.java @@ -75,7 +75,7 @@ public void run() { // Add header data for the decoding process ZonedDateTime utc = ZonedDateTime.now(ZoneOffset.UTC); - String timestamp = utc.format(DateTimeFormatter.ISO_INSTANT); + String timestamp = utc.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")); timMetadata.setOdeReceivedAt(timestamp); timMetadata.setOriginIp(senderIp);