title: How to get the Time from Firebase Realtime Database in my android chat app
body: <p>I'm building an simple chat app with Temporary chatRooms</p>
  
  <p>I'm using an single Text view to show username and chat message with below code</p>
  
  <pre><code>private void append_chat_conversation(DataSnapshot dataSnapshot) {
  
      Iterator i = dataSnapshot.getChildren().iterator();
  
      while (i.hasNext()){
  
             chat_msg = (String) ((DataSnapshot)i.next()).getValue();
          chat_user_name = (String) ((DataSnapshot)i.next()).getValue();
  
          chat_conversation.append(chat_user_name +" : "+chat_msg +" \n");
      }
  </code></pre>
  
  <p>and layout for the chat activity is </p>
  
  <pre><code> &lt;ScrollView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/scrollView"
      android:layout_alignParentTop="true"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:layout_above="@+id/btn_send"
      android:layout_alignRight="@+id/btn_send"
      android:layout_alignEnd="@+id/btn_send"&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:padding="15dp"
          android:layout_height="match_parent"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:id="@+id/textView" /&gt;
  &lt;/ScrollView&gt;
  </code></pre>
  
  <p>Now also I would like to show the Date and Time on which message received. How can I do this. For example, I will like to get the time as below in my app</p>
  
  <p><a href="https://i.stack.imgur.com/9Vp4Q.jpg" rel="nofollow noreferrer">Example Image</a></p>
  
  <p>My Firebase cloud structure is </p>
  
  <p><a href="https://i.stack.imgur.com/iGsKO.jpg" rel="nofollow noreferrer">Firebase Cloud Storage</a></p>
  
  <p>you can find the whole project here </p>
  
  <p><a href="https://github.com/miskoajkula/Firebase-RealtimeDatabase-App-Example" rel="nofollow noreferrer">https://github.com/miskoajkula/Firebase-RealtimeDatabase-App-Example</a></p>
  
  <p>Thanks in advance.</p>