0

How can I format string with date: 2015-02-17T12:12:17+01:00 to 17.02.2015, 12:12? This is possible? I read about SimpleDateFormat, but I don't know How can I write format for this example.

edi233
  • 3,511
  • 13
  • 56
  • 97

1 Answers1

2

editedThis is an example of SimpleDateFormat class use..hope this get you to the answer

String date_s = " 2011-01-18 00:00:00.0"; 
SimpleDateFormat dt = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss"); 
Date date = dt.parse(date_s);  
 SimpleDateFormat dt1 = new SimpleDateFormat(" yyyy-MM-dd'T'HH:mm:ssZ ");
 System.out.println(dt1.format(date));
Suraj Palwe
  • 2,080
  • 3
  • 26
  • 42