title: Dates, timezone and POSIXct
body: <p>I just fread a large datafile, and the "DATE" column is stored as character like O5JAN2004, 06JAN2004.The time in this datafile is matched to NewYork time, and I live in Los Angeles.</p>
  
  <p>Then I use as.Date to convert character to date.</p>
  
  <pre><code>t &lt;- as.Date(key$DATE[1], format = "%d%b%Y")
  [1] "2004-01-05"
  </code></pre>
  
  <p>But when I use as.POSIXct(t), it returns me:</p>
  
  <pre><code> &gt; as.POSIXct(t)
  [1] "2004-01-04 16:00:00 PST"
   &gt; as.POSIXlt(t)
  [1] "2004-01-05 UTC"
  </code></pre>
  
  <p>I tried several methods mentioned on website, but the result didn't change:</p>
  
  <pre><code>t &lt;- as.Date(key$DATE[1], format = "%d%b%Y", 'PST')
  t &lt;- as.Date(key$DATE[1], format = "%d%b%Y", 'EST')
  t &lt;- as.Date(key$DATE[1], format = "%d%b%Y", tz="America/New_York")
  t &lt;- as.Date(keyi$DATE[1], format = "%d%b%Y", tz="America/Los_Angeles")
  as.POSIXct(t, tz = "America/Los_Angeles")
  as.POSIXct(t, tz = "America/New_York")
  </code></pre>
  
  <p>I want to know: what could I do so when I use as.POSIXct(t), it would return me "2004-01-05 PST" or any other timezone.</p>
  
  <p>I am thinking because the Date is originally stored as character, so it wouldn't remember its original timezone, right?</p>
  
  <p>I do get</p>
  
  <pre><code>as.Date(as.POSIXct(t))
  &gt; "2004-01-05"
  </code></pre>
  
  <p>But why would as.POSIXct(t) return the previous result? Because I also have other data files and I would get "2004-01-05 PST" using as.POSIXct(t).</p>
  
  <p>Thank you!</p>