Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the date format that has been setup as default in Settings?

As you probably know, you can setup date format in the Settings of an Android device.

In code how do we make sure that we use that format for date display?

like image 843
Pentium10 Avatar asked May 14 '10 15:05

Pentium10


People also ask

What is the default formatting for dates?

The default date format shows as YYYY-MM-DD.

How do I change date format in settings?

Windows 10In the search box on the taskbar, type control panel, and then select Control Panel. Click Regional and Language Options. In the Region dialog box, click Additional settings. Click the Date tab.

What is the default date format in Windows?

By default, Microsoft Windows 10 and 11 use dd/mm/yyyy for dates and a 12-hour format for time.

How do I change date format from DD to MMM YYYY?

First, pick the cells that contain dates, then right-click and select Format Cells. Select Custom in the Number Tab, then type 'dd-mmm-yyyy' in the Type text box, then click okay.


1 Answers

Try android.text.format.DateFormat, notably getDateFormatOrder() to get the user's preferred date format.

like image 132
CommonsWare Avatar answered Sep 24 '22 10:09

CommonsWare