What is the correct way to use the android.text.format.DateFormat.format method -


I was reading the documentation for the Android Developers website (Android). To learn more about this, in particular I am trying to formulate the date of human readable, so I found the format (format, date of date in the extreme date) method and I thought I would use it. The best example I can get to use this method now looks like this: android.text.format.DateFormat.format ("MM / dd / yyyy", new java.util.Date ( )); However the documentation says:

Most callers should refrain from supplying methods of this class to their format string and depend on the correct localization given by the system. should remain.

It is from this line that my illusions and questions arise.

1.) The documentation does not appear in the state (at least I did not find it anywhere despite my most difficult search) How to use the right localized wires, which states that The system provides. How is this accomplished?

2.) Is it acceptable (despite the documentation) to provide your own format string as the example above?

Help!

1.) Document does not appear (at least I was unable to find it my most Regardless of the difficult search, to find it anywhere) How to use localized stars correctly, it tells us how the system provides it.

The easiest way is to get a stable get..Instance () methods such as getDateTimeInstance () to get the object

Use on the format object to get formatted strings.

It is often very easy to use.

/ P>

2.) Is it acceptable (despite the documentation) to provide your own format string as the example above?

When you are formatting, for example, to read the computer, yes, for example when serializing for an ASCII-based serialization format that requires a fixed date format is.

When man is formatted to read, then use the appropriate locale default.


Comments