Messy Date & Time String Reformatting

OK I did a combination of the

  • format “MM/dd/yy HH:mm a”
  • extract the hour
  • if the hour is 12 or AM nothing is added
  • if the hour is PM 12 hours are added
  • a date time shift brings back the military/real hour

I wonder why it would not work with the original format because Java should be able to do that. Please check the solution. We Europeans use to struggle with the AM/PM concept.

kn_example_messy_date_time.knwf (370.2 KB)

1 Like