Formatting Strings Like Dates and Times

Another aspect of internationalization is displaying data in the appropriate way. For example, U.S. dates are formatted MM/DD/YY and December 8, 1975, whereas much of the rest of the world uses the formats DD/MM/YY and 8 December, 1975. The Android SDK includes a number of locale-specific utilities. For example, you can use the DateFormat class (android.text.format.DateFormat) to generate date and time strings in the current locale, or you can customize date and time information as needed for your application.

Did you Know?

You can use the TimeUtils class (android.util.TimeUtils) to determine the time zone of a specified country by name.

0 0

Post a comment