title: How to get a time stamp posted?
body: <p>Hi I am trying to get a time stamp in the format of "posted: ten minutes ago" or "posted yesterday" or "posted three days ago" etc.  I want to have an activity with a button and when the button is clicked I want to open a new activity and display the time stamp in the format I explained in the new activity.   This is what I have so far:</p>
  
  <pre><code>public class MainActivity extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          Button b = (Button) findViewById(R.id.button1);
          b.setOnClickListener(new View.OnClickListener() {
  
              public void onClick(View v) {
                  long currentTime = System.currentTimeMillis();
  
                  Intent i = new Intent(MainActivity.this, Main2.class);
                  i.putExtra("currentTime", currentTime);
                  startActivity(i);
              }
          });
      }
  }
  </code></pre>
  
  <p>And activity two which I want to display the time stamp in the above format:</p>
  
  <pre><code>public class Main2 extends Activity{
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main2);
  
          Bundle extras = getIntent().getExtras();
          long currentTime = extras.getLong("currentTime");
      }
  
  
  }
  </code></pre>