Document SimpleDateFormat not thread-safe

This commit is contained in:
Paul Schaub 2022-03-07 10:26:24 +01:00
parent 126cc9df70
commit a7d1f09b5c
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 1 additions and 0 deletions

View File

@ -15,6 +15,7 @@ public final class DateUtil {
}
// Java's SimpleDateFormat is not thread-safe, therefore we return a new instance on every invocation.
public static SimpleDateFormat getParser() {
SimpleDateFormat parser = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
parser.setTimeZone(TimeZone.getTimeZone("UTC"));