-7

I have a Date object like this:

Fri Jan 29 13:22:57 GMT+01:00 2016

And I need it to look like this:

29.01.2016 13:22

How can I do that ?

Christer
  • 2,746
  • 3
  • 31
  • 50
  • 6
    What did you try so far? http://stackoverflow.com/questions/454315/how-do-you-format-date-and-time-in-android – Sven Rojek Jan 29 '16 at 14:05

1 Answers1

4

At First Post Your Code .

Please follow How do you format date and time in Android

Code for SimpleDateFormat . Just check the logic .

SimpleDateFormat timeStampFormat = new SimpleDateFormat("dd-yyyy-MM HHmm");
Date GetDate = new Date();
String DateStr = timeStampFormat.format(GetDate);

Now replace - as .

DateStr = DateStr.replace("-", ".");

Community
  • 1
  • 1
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198