title: How to change DateFormat like this? on Android
body: <p>This is UTC time from <code>django</code> rest <code>api</code>.</p>
  
  <p><strong>For example</strong></p>
  
  <pre><code>2016-09-26T02:58:26.154543Z
  
  2016-09-25T08:40:41.891129Z
  
  2016-09-24T13:25:16.397189Z
  </code></pre>
  
  <p>It comes as <code>"created_date": "2016-09-24T13:25:16.397189Z"</code>,</p>
  
  <p>And I want use it for this code</p>
  
  <pre><code>    public String beforeTime(Date date){
  
          long now = System.currentTimeMillis();
          long dateM = date.getTime();
  
          long gap = now - dateM;
  
          String ret = "";
  
  //        sec     min hour
  //        1000    60  60
          gap = (long)(gap/1000);
          long hour = gap/3600;
          gap = gap%3600;
          long min = gap/60;
          long sec = gap%60;
  
          if(hour &gt; 24){
              ret = new SimpleDateFormat("HH:mm").format(date);
          }
          else if(hour &gt; 0){
              ret = hour+"hours ago";
          }
          else if(min &gt; 0){
              ret = min+"mins ago";
          }
          else if(sec &gt; 0){
              ret = sec+"secs ago";
          }
          else{
              ret = new SimpleDateFormat("HH:mm").format(date);
          }
          return ret;
  
      } 
  </code></pre>
  
  <p>so I made a code, and it's for parameter of <code>beforeTime</code></p>
  
  <pre><code> String stringDate = "2016-09-26T03:02:37.477821Z"; #this is example
   java.text.SimpleDateFormat format = new java.text.SimpleDateFormat(
          "yyyy-MM-dd'T'HH:mm:ss.~~"); # i don't know this part
   java.util.Date dateToUse = format.parse(stringDate);
  </code></pre>
  
  <p><strong>Question :</strong> Please how to i set that format? "yyyy.MM.dd~~ " this, help me </p>