Thursday 15 September 2011

datetime - Date conversion to month and year in Android -


I have a date in the pattern 26/03/2013 . How can I get the equivalent month and year in the format of March 2013 in Android? 29-03-2017

I want to change this date in years and months.

like this:

  try {string dateString = "26 / 03/2013 "; SimpleDataformat SDF = New SimpleDormat ("DD / MM / YEA"); Date Date = sdf.parse (dateString); Simple Dataform Output Format = New SimpleDetermutation ("MMMM yyyy"); String formatteddate = output format Format (date); Log D. (TAG, "Date found:" + formatted date); } Hold (ParseException e) {e.printStackTrace (); }    

No comments:

Post a Comment