title: How to get seperate daily array from the weather API array which gives a 5 days every 3 hours report
body: <p>Please check if you can help anyone. I have been working on my weather app which I am building on React using axios with <a href="https://openweathermap.org/api" rel="nofollow noreferrer">openweathermap.org</a>
  and I am kind of stuck to get data the way I need it. I am using its 5day forecast. It gives you a report with every 3 hours forecast for 5 days.It gives you 40 reports for 5 days. so you get 8 reports for the 3 days in between and for current and the fifth day you get the remaining based on how much time left for current day. This is the API response for the  report: <a href="https://samples.openweathermap.org/data/2.5/forecast?id=524901&amp;appid=b6907d289e10d714a6e88b30761fae22" rel="nofollow noreferrer">report</a>.
  So you will get this as the reponse:</p>
  <pre><code>{
    &quot;data&quot;: {
  &quot;cod&quot;: &quot;200&quot;,
  &quot;message&quot;: 0.0062,
  &quot;cnt&quot;: 39,
  &quot;list&quot;: [
    {
      &quot;dt&quot;: 1540177200,
      &quot;main&quot;: {
        &quot;temp&quot;: 24.55,
        &quot;temp_min&quot;: 20.88,
        &quot;temp_max&quot;: 24.55,
        &quot;pressure&quot;: 1008.67,
        &quot;sea_level&quot;: 1025.96,
        &quot;grnd_level&quot;: 1008.67,
        &quot;humidity&quot;: 58,
        &quot;temp_kf&quot;: 3.67
      },
      &quot;weather&quot;: [
        {
          &quot;id&quot;: 800,
          &quot;main&quot;: &quot;Clear&quot;,
          &quot;description&quot;: &quot;clear sky&quot;,
          &quot;icon&quot;: &quot;02d&quot;
        }
      ],
      &quot;clouds&quot;: {
        &quot;all&quot;: 8
      },
      &quot;wind&quot;: {
        &quot;speed&quot;: 3.82,
        &quot;deg&quot;: 340.5
      },
      &quot;sys&quot;: {
        &quot;pod&quot;: &quot;d&quot;
      },
      &quot;dt_txt&quot;: &quot;2018-10-22 03:00:00&quot;
    },
    {
      &quot;dt&quot;: 1540188000,
      &quot;main&quot;: {
        ...
      },
    },
    {
      &quot;dt&quot;: 1540198800,
      &quot;main&quot;: {
       ...
      },
    },
    {
      &quot;dt&quot;: 1540587600,
      &quot;main&quot;: {
        . . .
      }
    }
  ]
  }
  </code></pre>
  <p>I just summarised it.I just put in the whole data for the first item and for the rest I put in ... and it is a long array with 40 items. Each one has a unique date timestamp which is &quot;dt&quot; in the beginning of it. I need to get 5 arrays based on a specific day. for that I thought of converting the timestamp(dt) and then get all the items that result in the same &quot;Day&quot;. Convert the timestamp like this (using forEach for all items):</p>
  <pre><code> let day ='';
   day = new Date(dt *1000);
   day = day.getDate();
  </code></pre>
  <p>There are two problems when I get converted array:</p>
  <ul>
  <li>I get one big array with 40 items again but I need 5 arrays based on the date so that I have the report of each day seperate</li>
  <li>Secondly I loose the dt in timestamp. I need to keep that so that I can show the weather forecast in my application.</li>
  </ul>
  <p>I want to show the info based on that timestamp for 5 days seperate.</p>
  <p>Thanks for your help and ideas everyone.</p>