title: Inconsistent date/time format when importing to R from Excel
body: <p>I've been working with an Excel file with dates in one column and the time of day in a second column. In Excel, the date column is formatted as "Date" and the time column is formatted as "Time". After trying myriad ways of importing these data from Excel into R, I finally found a way to get the data I wanted -- one column in an R data.frame of the date and time together as class POSIXct. First, when reading in the data using <code>read.xlsx2</code> from the package xlsx, I set the <code>colClasses</code> to <code>"numeric"</code> for both columns. This gives me, e.g., "16417" for the date and "0.3375000" for the time.</p>
  
  <p>Second, I combined them into one column by doing this:</p>
  
  <pre><code> as.POSIXct(as.Date(Data1$Date + Data1$Time,
                                    origin = "1970-01-01"), 
                            "%Y-%m-%d %H:%M:%S") + 60*60*8
  </code></pre>
  
  <p>This gives me the correct date and time (2014-12-13 08:06:00).</p>
  
  <p>However, when I attempted to do the same thing with a <em>second</em> Excel file with date and time in separate columns but formatted just the same as in the first Excel file (date column formatted as "Date" and time column formatted as "Time"), I get a different result! For the second file, what in Excel was, e.g., "12/13/2014" (date column) and "8:06:00 AM" (time column) results in "41986" for the date and "0.3375000" for the time, which becomes "2084-12-14 08:06:00" in R once I add those columns together!</p>
  
  <p>What's going on? Considering that people nearly always use Excel to supply me with data for analysis in R, <strong>what's the best way to deal with importing dates and times consistently into R from Excel?</strong> Why are the two dates different when saved in Excel and then imported into R the same way?</p>