Well aware of performance and thread issues with SimpleDateFormat
, I decided to go with FastDateFormat
, until I realized that FastDateFormat
is for formatting only, no parsing!
Is there an alternative to FastDateFormat
, that is ready to use out of the box and much faster than SimpleDateFormat
?
I believe FastDateFormat
is one of the faster ones, so anything that is about as fast would do.
Just curious , any idea why FastDateFormat
does not support parsing? Doesn't it seriously limit its use?
DateTimeFormatter is a replacement for the old SimpleDateFormat that is thread-safe and provides additional functionality.
Parsing is conversion of String into a java. util. Date instance. We can parse a string to a date instance using parse() method of the SimpleDateFormat class.
The java. text package provides a class named SimpleDateFormat which is used to format and parse dates in required manner (local). One of the constructors of this class accepts a String value representing the desired date format and constructors SimpleDateFormat object. The format() method of this class accepts a java.
Note that since commons-lang 3.2, FastDateFormat supports parsing as well as printing.
See: http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/time/FastDateFormat.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With