Github user ottobackwards commented on a diff in the pull request:
https://github.com/apache/metron/pull/1233#discussion_r226064136
--- Diff:
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/dsl/functions/DateFunctions.java
---
@@ -109,6 +110,13 @@ public static long getEpochTime(String date, String
format, Optional<String> tim
return sdf.parse(date).getTime();
}
+ public static String getDateFormat(String format, Optional<Long>
epochTime, Optional<String> timezone) {
+ Long time = epochTime.orElseGet(System::currentTimeMillis);
+ TimezonedFormat fmt = timezone.map(s -> new TimezonedFormat(format,
s)).orElseGet(() -> new TimezonedFormat(format));
+ SimpleDateFormat sdf = formatCache.get(fmt).get();
--- End diff --
are there any errors we need to wrap here?
---