I am receiving date and time format as mentioned below
2016-04-13T00:12:33+05:30
i need to convert above format to HH:MM:SS AM/PM
can any one guide me,your response will be appreciated......
I am receiving date and time format as mentioned below
2016-04-13T00:12:33+05:30
i need to convert above format to HH:MM:SS AM/PM
can any one guide me,your response will be appreciated......
SimpleDateFormat formatter = new SimpleDateFormat("hh:mm:ss a");
Log.i("date ====== " + formatter.format("2016-04-13T00:12:33+05:30"));
Android has the DateFormat class for parsing and reformatting dates as Strings, but JodaTime is much better. JodaTime is small and can handle what you're looking for in just a couple lines of code.
You need first String to Date using Simple forma tor
Then date need to change to formatResult fro expected result
SimpleDateFormat format = new SimpleDateFormat("dd-M-yyyy hh:mm:ss", Locale.ENGLISH);
SimpleDateFormat formatResult = new SimpleDateFormat("hh:mm aa");