简体   繁体   中英

How do I localize schedule sting in Android

I have a set of strings like "Friday 8:00am till 6:00pm", how do I localize this string to different languages.

I've tried to use 2 Calendars and SimpleDateFormat, but it doesn't support several values.

Use DateUtils.formatDateRange(...) to format time spans.

Formats a date or a time range according to the local conventions.

Although this will not allow you to localize parts of it yourself, it will provide a consistent user experience on the device and is properly localized. You can modify what and how it is displayed by providing various flags.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM