You are viewing a single comment's thread. Return to all comments →
Here's a solution in Clojure, doing manual string replacement instead of using Java's date functions:
(defn timeConversion [s] (let [[H M S] (re-seq #"\d+" s) ampm (if (clojure.string/ends-with? s "PM") 12 0) hour (+ ampm (Integer/parseInt H)) final-hour ({12 0, 24 12} hour hour)] (format "%02d:%s:%s" final-hour M S)))
Seems like cookies are disabled on this browser, please enable them to open this website
Time Conversion
You are viewing a single comment's thread. Return to all comments →
Here's a solution in Clojure, doing manual string replacement instead of using Java's date functions: