Friday 25 January 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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...