Synchronizing access to SimpleDateFormat

前端 未结 9 1471
名媛妹妹
名媛妹妹 2020-12-02 06:56

The javadoc for SimpleDateFormat states that SimpleDateFormat is not synchronized.

\"Date formats are not synchronized. It is recommended to create

9条回答
  •  遥遥无期
    2020-12-02 07:09

    The other option is Commons Lang FastDateFormat but you can only use it for date formatting and not parsing.

    Unlike Joda, it can function as a drop-in replacement for formatting. (Update: Since v3.3.2, FastDateFormat can produce a FastDateParser, which is a drop-in thread-safe replacement for SimpleDateFormat)

提交回复
热议问题