title: Format date for SQLite and subtract minutes
body: <p>I need to subtract an X number of minutes from the current date and format it for a SQLlite query in my Android app.  This is what I have so far:</p>
  
  <pre><code>Calendar cal = Calendar.getInstance();
  cal.add(Calendar.MINUTE, -60); //one hour back
  
  final SimpleDateFormat std = new SimpleDateFormat("yyyy-mm-dd hh:mm");
  std.setCalendar(cal);           
  String date = std.format(cal.getTime());
  
  String sql = "SELECT * FROM [tbl_name] WHERE [datefield] &gt;= " + date;
  </code></pre>
  
  <p>datefield is stored as a DATETIME in the SQLlite table.  I don't want to use Joda time because I want to keep the number of dependencies in my app to a minimum.</p>
  
  <p>With my current code, the date date variable is coming out as: '2012-43-05 07:43'</p>