I would like to use the date and time formats specified in the Android’s “Date & Time” settings. Is there an easy way to access this? I looked into the Settings class, however there is no constant that seems to have anything to do with these settings. Any help would be greatly appreciated.
Share
You can get the specific Format instances that the user specified by using the android.text.format.DateFormat class. With those you just do your normal Java style date formatting.
Unfortunately there’s no date AND time Format, so you’re going to have to build it by yourself. Or you can use
DateUtils.formatDateTime(), as Steve pointed out.