title: Is there an R equivalent of strtotime
body: <p>PHP has this wonderful function, <a href="http://php.net/strtotime" rel="noreferrer"><code>strtotime</code></a>, that takes any string containing just about any date format and returns a time (secs-since-1970). It is more future-proof than <code>strptime</code>, for instance, because if the date format changes my script does not break. Does R have anything similar?</p>
  
  <p>(I don't need the time-relative feature of strtotime as of today, but I'm sure at some point I'll need <code>strtotime("next Thursday")</code>, or <code>strtotime("first day of last month")</code>, so if you know R extensions that do that too, then I'd love to hear about it!)</p>
  
  <p><strong>UPDATE:</strong> If anyone (possibly me at some point in the future) want to try implementing this in R, or any other language, I tracked down <a href="http://svn.php.net/viewvc/php/php-src/trunk/ext/date/lib/" rel="noreferrer">the source code for it</a>. The relevant files are timelib.h, timelib.re and timelib_structs.h. It <em>appears</em> to all be standard C and standalone, no PHP headers to bring in. However the compile process compiles the *.re file into real C, so you will need to install and compile PHP at least once.</p>
  
  <p>The <a href="http://svn.php.net/viewvc/php/php-src/trunk/ext/date/php_date.c?view=markup" rel="noreferrer">code that calls it</a> is also quite straightforward (see lines 1428 to 1433, at the time of writing; the longer code above it in the same function is just to get the current time, for use in relative times).</p>