Reputation: 16147
I have this String Feb-16-2015 00:00
how do I convert this to another Date Time String with AM/PM ?
Upvotes: 1
Views: 2939
Reputation: 3846
First you will need to parse in into a Joda DateTime object, the call toString(String)
to get a custom format.
DateTime dt = DateTime.parse("Feb-16-2015 00:00", DateTimeFormat.forPattern("MMM-dd-yyyy HH:mm"));
dt.toString("MMM-dd-yyyy hh:mm a");
Upvotes: 5