Friday, January 25, 2019

java - Android date format not correct? dd/MM/yyyy

Try this,


    import android.text.format.DateFormat;
String dateString = (String) DateFormat.format("dd-MM-yyyy",new java.util.Date());

Check it with a simple toast message.


 Toast.makeText(getActivity(),dateString,Toast.LENGTH_SHORT).show();

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...