How do I get localized date pattern string?

前端 未结 10 2275
死守一世寂寞
死守一世寂寞 2020-11-28 05:31

It is quite easy to format and parse Java Date (or Calendar) classes using instance of DateFormat, i.e. I could format current date into short localize date like this:

10条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 06:15

    Since it's just the locale information you're after, I think what you'll have to do is locate the file which the JVM (OpenJDK or Harmony) actually uses as input to the whole Locale thing and figure out how to parse it. Or just use another source on the web (surely there's a list somewhere). That'll save those poor translators.

提交回复
热议问题