I used SimpleDataFormat and it seems to be not a very thread safe thing to use. Then I found that FastDateFormat is the alternative to this problem. But I'm trying to figure out how to use it in order to parse String with Date and Time.
Here is a explanation on why wrong use of SimpleDateFormat is bad : Why is Java's SimpleDateFormat not thread-safe?
Problem in code : I have following string
String date = "2014-04-27'T'13:45:31";
I need to convert that into Date
. But in a thread safe way. I would like to use something related to FastDateFormat
. Not the SimpleDateFormat
Parsing is supported since commons-lang 3.2.
The basic recipe:
That's it.