title: Android Date.getTime() adds one day to original Date
body: <p>So I have a calendar that I need to set a specific date to..</p>
  
  <pre><code>    Date date = TKDateUtils.parseDate("Jun 02, 2016 05:10:30 pm");
  
      Calendar next = Calendar.getInstance();
      next.setTime(date);
  </code></pre>
  
  <p>and I log them here to see the output:</p>
  
  <pre><code>    Log.i("MainActivity", date.toString());
      Log.i("MainActivity", date.getTime() + "");
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>    06-02 20:21:29.245 1915-1915/com.cyscorpions.timekeeper I/MainActivity: Thu Jun 02 17:10:30 EDT 2016
      06-02 20:21:29.245 1915-1915/com.cyscorpions.timekeeper I/MainActivity: 1464901830000
  </code></pre>
  
  <p>So I convert the <code>getTime</code> from millis to Date and this is the output:</p>
  
  <p><a href="https://i.stack.imgur.com/RwNVq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RwNVq.png" alt="enter image description here"></a></p>
  
  <p>So the <code>Date</code> is set to <code>June 2, 2016 17:10:30</code> but the <code>getTime()</code> is set to the exact day after that date.
  Am I doing something wrong here?</p>
  
  <p>Here is how I parse the date:</p>
  
  <pre><code>public static Date parseDate(@NonNull String dateString) {
      try {
          mDateFormat = new SimpleDateFormat("MMM dd, yyyy h:mm:ss a");
          return mDateFormat.parse(dateString);
      } catch (ParseException e) {
          e.printStackTrace();
      }
      return null;
  }
  </code></pre>