Hi Vijay,
For this output MM:DD:YY-T-HH:MM:SS try below code
Date date; | |
String output = ""; | |
SimpleDateFormat sdfSource = new SimpleDateFormat("MMddyyHHmm"); | |
SimpleDateFormat sdfDestination = new SimpleDateFormat("MM-dd-yy"); | |
SimpleDateFormat stfSouce = new SimpleDateFormat("MMddyyHHmm"); | |
SimpleDateFormat stfDestination = new SimpleDateFormat("HH:mm:ss"); | |
try{ | |
date = sdfSource.parse(sDate); | |
String TDate= sdfDestination.format(date); | |
date = stfSouce.parse(sDate); | |
String Ttime = stfDestination.format(date); | |
output = TDate +"-T-"+Ttime; | |
}catch(Exception e){ | |
} |
return output;
Regards,
Krupa
code updated.. Message was edited by: Krupa Rao Atluri