title: How would I go about adding a timestamp to a post?
body: <p>I'm not sure what to add to the following code to allow the post to have a time specified at the time the post was made...</p>
  
  <pre><code>    String currentDateTimeString = DateFormat.getDateTimeInstance().format(new Date());
  
  public void SendButtonClicked(View view){
      FirebaseUser mCurrentUser = mAuth.getCurrentUser();
      DatabaseReference mDatabaseUsers = FirebaseDatabase.getInstance().getReference().child("Users").child(mCurrentUser.getUid());
      final String messageValue = editMessage.getText().toString().trim();
      if (!TextUtils.isEmpty(messageValue)){
          final DatabaseReference newPost = mDatabase.push();
          mDatabaseUsers.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
                  newPost.child("time").setValue(currentDateTimeString());
                  newPost.child("content").setValue(messageValue);
                  newPost.child("username").setValue(dataSnapshot.child("UserName").getValue()).addOnCompleteListener(new OnCompleteListener&lt;Void&gt;() {
                      @Override
                      public void onComplete(@NonNull Task&lt;Void&gt; task) {
  
                      }
                  });
              }
  
              private Object currentDateTimeString() {
                  currentDateTimeString = 
              }
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
  
              }
          });
  </code></pre>
  
  <p>Do i need to implement a method, datasnapshot or would a string suffice?</p>