I just started working with Joda-Time, and got it to correctly display my date in 24-hour clock ("military time") but I would rather it be am/pm. Looked it up and it mentioned hourOfDay which I figured was the HH value so I tried to write a loop that would break it down into AM/Pm but it never worked out.
DateTime dtf = new DateTime(wikiParsedDate);
if (hourOfDay == 00) {
hourOfDay == 12;
DateTimeFormatter builder = DateTimeFormat.forPattern( "dd-MM-yyyy HH:mm:ss.SS'AM" );
return builder.print(dtf);
} else if (0 < hourOfDay && hourOfDay < 12) {
DateTimeFormatter builder = DateTimeFormat.forPattern( "dd-MM-yyyy HH:mm:ss.SS'AM" );
return builder.print(dtf);
} else if (hourOfDay > 12) {
hourOfDay - 12 == hourOfDay;
DateTimeFormatter builder = DateTimeFormat.forPattern( "dd-MM-yyyy HH:mm:ss.SS'PM" );
return builder.print(dtf);
}
}