SimpleDateFormat warning To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(),

后端 未结 3 1871
再見小時候
再見小時候 2020-12-25 10:30

Do i need to be worried about this warning? What if I ignore the warning?
What does this warning mean:
To get local formatting use getDateInstance(),

3条回答
  •  醉梦人生
    2020-12-25 11:10

    You can ignore it, but the warning is there to let you know the dates may display unexpectedly for users using a different language. If you want to force the format in your own locale, use Locale.US (or whichever locale matches your format requirements). Otherwise use one of the getInstance() methods for localized formatting.

提交回复
热议问题