summaryrefslogtreecommitdiffstats
path: root/aai-els-onap-logging
diff options
context:
space:
mode:
authorNandkishor Patke <nandkishor-laxman.patke@t-systems.com>2024-10-09 09:24:23 +0000
committerGerrit Code Review <gerrit@onap.org>2024-10-09 09:24:23 +0000
commitcc343f0701d094de1ccc3fa3459d10e0fdc8db49 (patch)
tree15fef77e226aa9c132e0f15de825ba92510aa6c6 /aai-els-onap-logging
parentb53da76193279c6004bb27cc0db5f7bfa2d118e4 (diff)
parent180f2967c7db5cbbace67616146a66d9d9658af7 (diff)
Merge "Refactor UEBNotification class"
Diffstat (limited to 'aai-els-onap-logging')
-rw-r--r--aai-els-onap-logging/src/main/java/org/onap/aai/util/FormatDate.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/aai-els-onap-logging/src/main/java/org/onap/aai/util/FormatDate.java b/aai-els-onap-logging/src/main/java/org/onap/aai/util/FormatDate.java
index 9ee2b71d..4243c539 100644
--- a/aai-els-onap-logging/src/main/java/org/onap/aai/util/FormatDate.java
+++ b/aai-els-onap-logging/src/main/java/org/onap/aai/util/FormatDate.java
@@ -27,21 +27,18 @@ import java.time.format.DateTimeFormatter;
public class FormatDate {
private final String timeZone;
- private final String pattern;
+ private final DateTimeFormatter formatter ;
public FormatDate(String pattern) {
- this.pattern = pattern;
- this.timeZone = "GMT";
+ this(pattern, "GMT");
}
public FormatDate(String pattern, String timeZone) {
- this.pattern = pattern;
this.timeZone = timeZone;
+ this.formatter = DateTimeFormatter.ofPattern(pattern);
}
public String getDateTime() {
-
- final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
return formatter.format(ZonedDateTime.now(ZoneId.of(timeZone)));
}
}