title: Weather API how to get data through JSON with 9 hours gap
body: <p>I have <a href="http://api.apixu.com/v1/forecast.json?key=a7ae9451110d406489f112831171408&amp;q=hyderabad&amp;days=10" rel="nofollow noreferrer">a weather API</a> and I want forecast temperature with 9 hours gap according to our current date and time list</p>
  
  <p>If current time is 12:00 then it should display temperature of 9:00 then 18:00 then next day temp at 3:00 hour then 12:00 then 21:00 like this upto 5 days using webservice.</p>
  
  <pre><code>ArrayList&lt;ForecastWeather&gt; product_new_arrayy = new ArrayList&lt;&gt;();
          for(int z = 0; z &lt; arrJson.length(); z++)
          {
          JSONObject object3e = arrJson.getJSONObject(z);
          Log.v("hour", object3e.toString());
  
          JSONArray houre = object3e.getJSONArray("hour");
          //Toast.makeText(this, "" + hour, Toast.LENGTH_SHORT).show();
          // int x=foo;
  
  
          stimee = object3e.getString("date");
  
  
          List&lt;String&gt; answers = new ArrayList&lt;String&gt;();
          for(int x=0; x&lt;houre.length(); x++) {
  
  
          JSONObject persone = (JSONObject) houre.get(x);
  
  
          timee = persone.getString("time");
  
          answers.add(timee);
  
  
  
  
  
  
          String[] daysArray = new String[] {"sunday","monday","tuesday","wednesday","thursday","friday","saturday"};
          String day = "";
  
          int dayOfWeek =0;
  
          SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
          Date datee;
          try {
          datee = formatter.parse(timee);
          Calendar c = Calendar.getInstance();
          c.setTime(datee);
          dayOfWeek = c.get(Calendar.DAY_OF_WEEK)-1;
          if (dayOfWeek &lt; 0) {
          dayOfWeek += 7;
          }
          day = daysArray[dayOfWeek];
          } catch (Exception e) {
          e.printStackTrace();
          }
  
          ForecastWeather fw = new ForecastWeather();
          fw.setTemperature(persone.getString("temp_c") + (char) 0x00B0 + "C" );
          timee = persone.getString("time");
          String timeappoch =persone.getString("time_epoch");
  
          int timea = Integer.parseInt(timeappoch);
          int addd= timea+32400000;
  
          Log.v("Add",""+ addd );
  
  
          fw.setTime(day + "\n\n" + timee  );
          product_new_arrayy.add(fw);
  
  
  
  
  
          Log.v("array", timee );
  //                            
          jsonArrayResponsee  += "Day at: " + day +" " + timee +" \n\n" + "Temp:" + namee + (char) 0x00B0 + "C" + "\n\n";
  
  
  
          }
          Log.v("HHH", answers.toString());
          Calendar cal = Calendar.getInstance();
  
          SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd");
          String datetime = dateformat.format(cal.getTime());
  
          if(answers.contains(datetime)){
  
  
  
          }
  
  
          }
          ArrayList &lt;ForecastWeather&gt; all = new ArrayList &lt;&gt;();
          all.addAll(product_new_arrayy);
  
          showAllProducts(all);
  </code></pre>
  
  <p>I m getting all days and every hour temperature but i want 9 hour gap </p>