title: PHP's strtotime() in Java
body: <p>strtotime() in PHP can do the following transformations:</p>
  
  <p>Inputs:</p>
  
  <pre>
  strtotime(’2004-02-12T15:19:21+00:00′);
  strtotime(’Thu, 21 Dec 2000 16:01:07 +0200′);
  strtotime(’Monday, January 1st’);
  strtotime(’tomorrow’);
  strtotime(’-1 week 2 days 4 hours 2 seconds’);
  </pre>
  
  <p>Outputs:</p>
  
  <pre>
  2004-02-12 07:02:21
  2000-12-21 06:12:07
  2009-01-01 12:01:00
  2009-02-12 12:02:00
  2009-02-06 09:02:41
  </pre>
  
  <p>Is there an easy way to do this in java?</p>
  
  <p>Yes, this is a <a href="https://stackoverflow.com/questions/1236678/phps-strtotime-in-java">duplicate</a>.  However, the original question was not answered.  I typically need the ability to query dates from the past.  I want to give the user the ability to say 'I want all events from "-1 week" to "now"'.  It will make scripting these types of requests much easier.</p>