title: How to store a Date object in SharedPreferences?
body: <p>Is it possible to store a <code>Date</code> object using <code>SharedPreferences</code>?</p>
  
  <p>Actually in my code I have a <code>String</code> variable, <code>boolean</code> and <code>Date</code>. Here is my function for storing all the objects except <code>Date</code>. So how that can be done please suggest me?</p>
  
  <pre><code>private void SavePreferences() {
  
      String key="1";
      String value="hello";
  
      int x=5;
  
      Date currentDate=new Date();
  
      SharedPreferences sharedPreferences = getPreferences(MODE_APPEND);
      SharedPreferences.Editor editor = sharedPreferences.edit();
      editor.putString(key, value);
  
      editor.putInt("2",5);
  
      editor.commit();
  }
  </code></pre>
  
  <p>So my question is how to store the <code>Date</code> using <code>SharedPreferences</code>?</p>