title: How to sort List of Maps based on the date string inside the map with different date formats in java?
body: <p>I am currently creating an API that combines outputs from 2 APIs (which are already immutable/impossible to change). I need to get their data and then sort them based on the attribute <code>created_date</code>.</p>
  <p>This is the output format from the 1st API:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;data&quot; : [
      {
        &quot;created_date&quot;: &quot;2021-11-21&quot;,
        &quot;name&quot;: &quot;test 1&quot;
      }
    ]
  ...
  </code></pre>
  <p>And this is the output format from the 2nd API:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;data&quot; : [
      {
        &quot;created_date&quot;: &quot;21-10-2021 09:21:37&quot;,
        &quot;name&quot;: &quot;test 1&quot;
      }
    ]
  ...
  </code></pre>
  <p>Then I combined them into an array, but I wonder how to do the sorting based on the <code>created_date</code> in efficient way? Because, if I use loops to sort one-by-one, it would be highly inefficient in my case where the data already hundreds of records on both APIs. Any help is greatly appreciated. Thank you in advance.</p>