title: How to Add Date / Time from OData Service Correctly to UI?
body: <h2>Context</h2>
  
  <p>I'm creating a little demo page that displays some straight forward functionality of UI5. This page consists of two main pages:</p>
  
  <ul>
  <li>On the first page, there's a list of carriers which can be created, deleted, and updated. These carriers have an ID (<code>Carrid</code>).</li>
  <li>If one clicks a carrier, they get routed to the second page on which all the flights of the selected carrier are shown in a table (with some information about the flights).</li>
  </ul>
  
  <p>The table looks like this:</p>
  
  <pre><code>&lt;Table id="detailTable" inset="false" class="sapUiResponsiveMargin"&gt;
      &lt;columns&gt;
          &lt;Column&gt;
              &lt;Text text="ID" /&gt;
          &lt;/Column&gt;
          &lt;Column&gt;
              &lt;Text text="Flightnumber" /&gt;
          &lt;/Column&gt;
          &lt;Column&gt;
              &lt;Text text="Starts in" /&gt;
          &lt;/Column&gt;
          &lt;Column&gt;
              &lt;Text text="Departs at" /&gt;   
          &lt;/Column&gt; 
          &lt;Column&gt;
              &lt;Text text="Lands in" /&gt;   
          &lt;/Column&gt; 
          &lt;Column&gt;
              &lt;Text text="Lands at" /&gt;   
          &lt;/Column&gt;
      &lt;/columns&gt;
  &lt;/Table&gt;
  </code></pre>
  
  <p>The data is bound to the columns with this code:</p>
  
  <pre><code>// Get routing data and show only entrys with the matched primary key (Carrid)
  _onRouteMatched: function(oEvent) {
      // ...
      var oArgs = oEvent.getParameter("arguments");
      var oFlightTable = oView.byId("detailTable");
      oFlightTable.bindAggregation("items", {
          path: "/CarrierSet(" + "'" + oArgs.flightPath + "'" + ")/FlightSet",
          template: new sap.m.ColumnListItem({
              cells: [
                  new sap.m.Text({
                      text: "{Carrid}"
                  }),
                  new sap.m.Text({
                      text: "{Connid}"
                  }),
                  new sap.m.Text({
                      text: "{Cityfrom}"
                  }),
                  new sap.m.Text({
                      text: "{Deptime}"
                  }),
                  new sap.m.Text({
                      text: "{Cityto}"
                  }),
                  new sap.m.Text({
                      text: "{Arrtime}"
                  })
              ]
          })
      });
  }
  </code></pre>
  
  <h2>Problem</h2>
  
  <p>The code works fine if the data can be shown without manipulating it first. But the fields <code>{Deptime}</code> and <code>{Arrtime}</code> have the type <a href="http://www.odata.org/documentation/odata-version-2-0/overview/#AbstractTypeSystem" rel="nofollow noreferrer"><em>Edm.Time</em></a> which I need to convert first in order to display it in a human readable form.<br>
  I was able to achieve this with this bit of code (I know, not the most efficient way, but im still learning. So if you have any improvements, feel free to post them):</p>
  
  <pre><code>pageTable.addEventDelegate({
      onAfterRendering: function() {
          var mTable = this.getView("FilterBarSimple").byId("detailTable");
          var mModel = mTable.getModel();
          var aItems = mTable.getItems();
  
          // ----- TIME CONVERSION ----
  
          var arrayTime = [];
          for (var iTime = 0; iTime &lt; aItems.length; iTime++) {
              var iAdded = mModel.getProperty("Deptime", aItems[iTime].getBindingContext());
              arrayTime.push(iAdded);
          }
          var timeFormat = sap.ui.core.format.DateFormat.getTimeInstance({
              pattern: "kk:mm:ss"
          });
          var tz = new Date(0).getTimezoneOffset() * 60 * 1000;
          var arrayTimeClean = [];
          $.each(arrayTime, function(ii, ee) {
              var timeStr = timeFormat.format(new Date(ee.ms + tz));
              arrayTimeClean.push(timeStr);
          });
      }
  });
  </code></pre>
  
  <p>This generates this output which is correct:<br>
  <a href="https://i.stack.imgur.com/zhyvp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zhyvp.png" alt="Image_Of_Converted_Output"></a></p>
  
  <p>But I'm not able to correctly bind this manipulated data into the table again. I've tried it with the <code>OData.read()</code> function and some other rather hacky approaches but I was never successful and I'm stuck with this problem for quite some time now.</p>
  
  <p>If anyone has an idea or a suggestion, I'd be more than thankful if you let me know.</p>