Skip to content

Commit

Permalink
Merge pull request #1323 from dadoonet/wp/wrong-date-format
Browse files Browse the repository at this point in the history
Add more traces when converting dates
  • Loading branch information
dadoonet authored Dec 13, 2021
2 parents 7922e3f + 8c73d81 commit 9ce63de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ public static String generateDefaultCustomSourceName(String suffix) {
}

public static String toRFC3339(Date d) {
if (logger.isDebugEnabled() && d != null) {
String format = RFC_3339.format(d);
String finalDate = format.replaceAll("(\\d\\d)(\\d\\d)$", "$1:$2");
logger.debug("Transforming date to RFC_3339 [{}] -> [{}] -> [{}]", d, format, finalDate);
}
return d == null ? null : RFC_3339.format(d).replaceAll("(\\d\\d)(\\d\\d)$", "$1:$2");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import fr.pilato.elasticsearch.crawler.fs.test.framework.AbstractFSCrawlerTestCase;
import org.junit.Test;

import java.text.ParseException;
import java.util.Date;

import static com.carrotsearch.randomizedtesting.RandomizedTest.randomAsciiAlphanumOfLength;
Expand Down

0 comments on commit 9ce63de

Please sign in to comment.