We usually met many dates user input manually, it is hard for program processing. This library used for unify it to ISO 8601 Standard format YYYY-mm-dd.
dateformatter is written by Scala and using regular expression to distinguish those formats. There were a large number of date examples in test folder.
Before test, working directory should be set to project root folder.
scala 2.11.8, spark 2.4.0
Input | Output |
---|---|
20121103112058 | P7-2012-11-03 |
2017-06-16 12:00:00 | P1-2017-06-16 |
2016.04.01 | P1-2016-04-01 |
2017年4月5日 | P1-2017-4-5 |
16 June 2017 | P2-2017-6-16 |
22-07-2019 | P4-2019-07-22 |
6. března 2015 12:00:00 | P4-2015-3-6 |
27 февраля 2015 | P2-2015-2-27 |