title: Why react-native-gifted-chat not displaying time correctly from firebase timestamp?
body: <p>I used <a href="https://github.com/FaridSafi/react-native-gifted-chat" rel="nofollow noreferrer">react-native-gifted-chat</a> in my app to add chat feature. Currently I am able to send and receive message from firebase properly. But, the problem is that <code>react-native-gifted-chat</code> always displays 12:00 AM of message send time. This is because it not able to convert firebase timestamp into time. Can anyone please help me how can I solve it ?</p>
  
  <p>Here is the how I used <strong>GiftedChat</strong> component :</p>
  
  <pre class="lang-js prettyprint-override"><code>&lt;GiftedChat
    messages={this.props.messages}
    renderUsernameOnMessage={true}
    onSend={messages =&gt; this.onSend(messages)}
    alwaysShowSend={true}
    textInputStyle={styles.composer}
    minComposerHeight={40}
    minInputToolbarHeight={60}
    user={{
      _id: this.props.account ?.user ?.uid,
      name: this.props.account ?.data ?.fullName,
      avatar: this.props.account ?.data ?.avatar
    }}
  /&gt;
  </code></pre>
  
  <p>Below is the code that i used for saving message in firestore : </p>
  
  <pre class="lang-js prettyprint-override"><code>export const sendMessage = (message, groupId) =&gt; {
    return async () =&gt; {
      await firestore().collection('groupMessages').doc(groupId).collection('messages').doc(message._id).set(message).catch((e) =&gt; {
        throw {message: e.message.replace(`[${e.code}] `, '')}
      });
    }
  }
  </code></pre>
  
  <p>In above code <code>message</code> is gifted chat message which contains properties : <code>_id</code>, <code>text</code>, <code>createdAt</code> and <code>user</code>. </p>
  
  <p>Here is how message is stored in firebase : </p>
  
  <p><a href="https://i.stack.imgur.com/X79DO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/X79DO.png" alt="Firebase message structure"></a></p>
  
  <p>When I display message : </p>
  
  <p><a href="https://i.stack.imgur.com/krOvU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/krOvU.png" alt="Message"></a></p>