In the process of migrating from the classic API I have<br>found what appears to be a problem with Rcpp::Datetime.<br>There is no unit test for this situation.<br><br>Rcpp::Datetime dt(&quot;2015-04-15 06:00:00&quot;)<br>and<br>
Rcpp::Datetime dt(&quot;2015-04-15 06:00:00.0&quot;)<br>both fail due to a type conversion error.<br><br>Here is the original constructor:<br>Datetime::Datetime(const std::string &amp;s, const std::string &amp;fmt) {<br>        Rcpp::Function strptime(&quot;strptime&quot;);    // we cheat and call strptime() from R<br>
        m_dt = Rcpp::as&lt;double&gt;(strptime(s, fmt));<br>        update_tm();<br>}<br><br>The problem is that strptime() returns POSIXlt type, not POSIXct type.<br>Adding Rcpp::Function asPOSIXct(&quot;as.POSIXct&quot;) and using it<br>
to convert seems to fix the problem.<br><br>Dominick<br><br><br>