SimpleDateFormat
is a concrete class for formatting and parsing dates in a locale-sensitive manner.
From the JavaDoc
,
But Date formats are not synchronized. It is recommended to create separate format instances for each thread. If multiple threads access a format concurrently,
it must be synchronized externally
.
To make the SimpleDateFormat class thread-safe, look at the following approaches :