title: openweathermap api: get 1 time slot from 5 day forcast
body: <p>I am using the openweathermap api <a href="http://openweathermap" rel="nofollow noreferrer">5 day/ 3 hour forecast</a> </p>
  
  <p>I get the following result set. There are multiple results for each day. Every 3 hours have a result. Here is the api call in full to get the full json <a href="https://api.openweathermap.org/data/2.5/forecast?id=3362024&amp;APPID=bbcf57969e78d1300a815765b7d587f0&amp;units=metric" rel="nofollow noreferrer">https://api.openweathermap.org/data/2.5/forecast?id=3362024&amp;APPID=bbcf57969e78d1300a815765b7d587f0&amp;units=metric</a> .The api key is just for testing by the way.</p>
  
  <pre><code>{
  "cod": "200",
  "message": 0.0034,
  "cnt": 37,
  "list": [
  {
  "dt": 1518512400,
  "main": {
  "temp": 23.79,
  "temp_min": 21.5,
  "temp_max": 23.79,
  "pressure": 1021.76,
  "sea_level": 1029.07,
  "grnd_level": 1021.76,
  "humidity": 74,
  "temp_kf": 2.29
  },
  "weather": [1 item],
  "clouds": {1 item},
  "wind": {2 items},
  "rain": {1 item},
  "sys": {1 item},
  "dt_txt": "2018-02-13 09:00:00"
  },
  {
  "dt": 1518523200,
  "main": {
  "temp": 26.2,
  "temp_min": 24.68,
  "temp_max": 26.2,
  "pressure": 1019.83,
  "sea_level": 1027.02,
  "grnd_level": 1019.83,
  "humidity": 63,
  "temp_kf": 1.52
  },
  "weather": [1 item],
  "clouds": {1 item},
  "wind": {2 items},
  "rain": {},
  "sys": {1 item},
  "dt_txt": "2018-02-13 12:00:00"
  },
  {
  "dt": 1518534000,
  "main": {
  "temp": 25.8,
  "temp_min": 25.04,
  "temp_max": 25.8,
  "pressure": 1018.1,
  "sea_level": 1025.39,
  "grnd_level": 1018.1,
  "humidity": 60,
  "temp_kf": 0.76
  },
  "weather": [1 item],
  "clouds": {1 item},
  "wind": {2 items},
  "rain": {},
  "sys": {1 item},
  "dt_txt": "2018-02-13 15:00:00"
  },
  {8 items},
  {8 items},
  {
  "dt": 1518566400,
  "main": {
  "temp": 18.47,
  "temp_min": 18.47,
  "temp_max": 18.47,
  "pressure": 1019.07,
  "sea_level": 1026.25,
  "grnd_level": 1019.07,
  "humidity": 91,
  "temp_kf": 0
  },
  "weather": [1 item],
  "clouds": {1 item},
  "wind": {2 items},
  "rain": {1 item},
  "sys": {1 item},
  "dt_txt": "2018-02-14 00:00:00"
  },
  {
  "dt": 1518577200,
  "main": {
  "temp": 18.48,
  "temp_min": 18.48,
  "temp_max": 18.48,
  "pressure": 1017.23,
  "sea_level": 1024.63,
  "grnd_level": 1017.23,
  "humidity": 91,
  "temp_kf": 0
  },
  "weather": [1 item],
  "clouds": {1 item},
  "wind": {2 items},
  "rain": {1 item},
  "sys": {1 item},
  "dt_txt": "2018-02-14 03:00:00"
  },
  {
  "dt": 1518588000,
  "main": {
  "temp": 18.11,
  "temp_min": 18.11,
  "temp_max": 18.11,
  "pressure": 1018.54,
  "sea_level": 1025.84,
  "grnd_level": 1018.54,
  "humidity": 94,
  "temp_kf": 0
  },
  "weather": [1 item],
  "clouds": {1 item},
  "wind": {2 items},
  "rain": {1 item},
  "sys": {1 item},
  "dt_txt": "2018-02-14 06:00:00"
  },
  {
  "dt": 1518598800,
  "main": {
  "temp": 19.59,
  "temp_min": 19.59,
  "temp_max": 19.59,
  "pressure": 1018.87,
  "sea_level": 1026.14,
  "grnd_level": 1018.87,
  "humidity": 87,
  "temp_kf": 0
  },
  "weather": [1 item],
  "clouds": {1 item},
  "wind": {2 items},
  "rain": {},
  "sys": {1 item},
  "dt_txt": "2018-02-14 09:00:00"
  },
  {
  "dt": 1518609600,
  "main": {
  "temp": 21.38,
  "temp_min": 21.38,
  "temp_max": 21.38,
  "pressure": 1017.75,
  "sea_level": 1024.92,
  "grnd_level": 1017.75,
  "humidity": 80,
  "temp_kf": 0
  },
  "weather": [1 item],
  "clouds": {1 item},
  "wind": {2 items},
  "rain": {1 item},
  "sys": {1 item},
  "dt_txt": "2018-02-14 12:00:00"
  },
  {
  "dt": 1518620400,
  "main": {
  "temp": 20.64,
  "temp_min": 20.64,
  "temp_max": 20.64,
  "pressure": 1017.45,
  "sea_level": 1024.32,
  "grnd_level": 1017.45,
  "humidity": 83,
  "temp_kf": 0
  },
  "weather": [1 item],
  "clouds": {1 item},
  "wind": {2 items},
  "rain": {1 item},
  "sys": {1 item},
  "dt_txt": "2018-02-14 15:00:00"
  },
  {
  "dt": 1518631200,
  "main": {
  "temp": 19.29,
  "temp_min": 19.29,
  "temp_max": 19.29,
  "pressure": 1017.61,
  "sea_level": 1024.57,
  "grnd_level": 1017.61,
  "humidity": 90,
  "temp_kf": 0
  },
  "weather": [1 item],
  "clouds": {1 item},
  "wind": {2 items},
  "rain": {1 item},
  "sys": {1 item},
  "dt_txt": "2018-02-14 18:00:00"
  },
  {
  "dt": 1518642000,
  "main": {
  "temp": 18.93,
  "temp_min": 18.93,
  "temp_max": 18.93,
  "pressure": 1018.43,
  "sea_level": 1025.58,
  "grnd_level": 1018.43,
  "humidity": 90,
  "temp_kf": 0
  },
  "weather": [1 item],
  "clouds": {1 item},
  "wind": {2 items},
  "rain": {1 item},
  "sys": {1 item},
  "dt_txt": "2018-02-14 21:00:00"
  }
  ],
  "city": {
  "id": 3362024,
  "name": "Rosebank",
  "coord": {
  "lat": -33.9556,
  "lon": 18.4742
  },
  "country": "ZA"
  }
  }
  </code></pre>
  
  <p>My problem is that I need only the "12:00" time slot for each day and the data comes back with multiple time slots for each day.</p>
  
  <p>I have tried the following but am not getting it right</p>
  
  <pre><code>  getData(){
      var arraycontainsMidday;
      this.http.get('https://api.openweathermap.org/data/2.5/forecast?id=3362024&amp;APPID=bbcf57969e78d1300a815765b7d587f0&amp;units=metric').map(res=&gt;res.json()).subscribe(data =&gt; {
      this.items = data;
        for(var i = 0; i &lt; this.items.list.length; i++){
          this.dates = this.items.list[i].dt_txt.substring(10);
          this.temps = this.items.list[i].main;
          //if 12 o'clock middat is found
          arraycontainsMidday = (this.dates.indexOf("12:00:00") &gt; -1);
        }
  
        for(var j = 0; j &lt; this.items.list.length; j++){
          this.temps = this.items.list[j].main.temp;
        }
  
      })
    }
  </code></pre>