[ https://issues.apache.org/jira/browse/METRON-1816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16655565#comment-16655565 ]
ASF GitHub Bot commented on METRON-1816: ---------------------------------------- Github user merrimanr commented on a diff in the pull request: https://github.com/apache/metron/pull/1233#discussion_r226383027 --- 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 -- There are no exceptions thrown by any calls in this method. What are you thinking we should do? > Date format Stellar function > ---------------------------- > > Key: METRON-1816 > URL: https://issues.apache.org/jira/browse/METRON-1816 > Project: Metron > Issue Type: Improvement > Reporter: Ryan Merriman > Priority: Major > > It would be useful to have a Stellar function that exposes the Java > SimpleDateFormat capability. This will allow us to correctly format date > fields for storage platforms that require a specific date format (Solr for > example). -- This message was sent by Atlassian JIRA (v7.6.3#76005)