title: Date arithmetic in Erlang
body: <p>I have a date in this format <code>{Y,M,D}</code>. Is there any good supporting libraries or, tricks I can use to simply, say subtract three months from this date without running into problem with invalid dates, leap years, etc.</p>
  
  <p>My latest similar use is in MySql where you can type:</p>
  
  <pre><code>Select '2011-05-31' - Interval 3 Month;
  </code></pre>
  
  <p>which yields <code>'2011-02-28'</code>. I am not interested in how to write this library myself, that is what I would like to avoid.</p>