title: Change from date time to numeric AND back to date time in R
body: <p><strong>Seeing that others can't reproduce this</strong> Any speculation about system settings that might cause what I'm seeing would be appreciated. This is on a work PC configured by IT, but I will compare with my personal install this evening and then update the question.</p>
  
  <p>Using base R, I'm trying to read in date and time, convert to numeric, and then convert back to date time.  The problem I'm running into is a + 5 hour shift that gets introduced, I think due to timezone defaults.  </p>
  
  <p>From a previous question, an example of date time to numeric was provided:
  <a href="https://stackoverflow.com/questions/8215404/change-from-date-and-hour-format-to-numeric-format">Change from date and hour format to numeric format</a></p>
  
  <pre><code>&gt; x &lt;- as.POSIXct("9/27/2011  3:33:00 PM", format="%m/%d/%Y  %H:%M:%S %p")
  &gt; x
  [1] "2011-09-27 03:33:00 EDT"
  &gt; y &lt;- as.numeric(x)
  [1] 1317108780
  </code></pre>
  
  <p>*<em>Typo in above code fixed</em></p>
  
  <p>When I try to bring this back to date time, I get:</p>
  
  <pre><code>&gt; z &lt;- as.POSIXct(y, origin="1970-01-01")
  &gt; z
  [1] "2011-09-27 08:33:00 EDT" 
  </code></pre>
  
  <p>I tried some variants, including specifying time zones explicitly, but am consistently getting this shift.   </p>