title: How to pass a date to R from Python using rpy2
body: <p>I want to call a function from R which requires a Date object. I'm struggling to call this function using Rpy2.</p>
  <p>Here's an example: An R function that takes a date</p>
  <pre><code>d &lt;- as.Date(&quot;2009-08-17&quot;)
  format(d, &quot;%d/%m/%Y&quot;)
  [1] &quot;17/08/2009&quot;
  </code></pre>
  <p>Now I want to call this function from python</p>
  <pre><code>import datetime as dt
  import rpy2.robjects.packages as rpackages
  base = rpackages.importr(&quot;base&quot;) 
  d = dt.date(year=2009, month=8, day=17)
  base.format(d, format = &quot;%d/%m/%y&quot;)
  </code></pre>
  <p>The last line throws the exception</p>
  <pre><code>NotImplementedError: Conversion 'py2ri' not defined for objects of type    '&lt;class 'datetime.datetime'&gt;'
  </code></pre>
  <p>Any ideas how I can pass dates from python to function in R expecting as.Date(xxx) arguments?</p>
  <p>fyi - I'm not looking for pure python code to convert the format of the date string. I want to know how to pass dates via rpy2</p>