title: Reading timestamp data in R from multiple time zones
body: <p>I have a column of time stamps in character format that looks like this:</p>
  
  <p>2015-09-24 06:00:00 UTC</p>
  
  <p>2015-09-24 05:00:00 UTC</p>
  
  <pre><code>dateTimeZone &lt;- c("2015-09-24 06:00:00 UTC","2015-09-24 05:00:00 UTC")
  </code></pre>
  
  <p>I'd like to convert this character data into time data using POSIXct, and if I knew that all the time stamps were in UTC, I would do it like this:</p>
  
  <pre><code>dateTimeZone &lt;- asPOSIXct(dateTimeZone, tz="UTC")
  </code></pre>
  
  <p>However, I don't necessarily know that all the time stamps are in UTC, so I tried</p>
  
  <pre><code>dateTimeZone &lt;- asPOSIXct(dateTimeZodateTimeZone, format = "%Y-%m-%d %H:%M:%S %Z")
  </code></pre>
  
  <p>However, because strptime supports %Z only for output, this returns the following error:</p>
  
  <blockquote>
    <p>Error in strptime(x, format, tz = tz) : 
      use of %Z for input is not supported</p>
  </blockquote>
  
  <p>I checked the documentation for the lubridate package, and I couldn't see that it handled this issue any differently than POSIXct.</p>
  
  <p>Is my only option to check the time zone of each row and then use the appropriate time zone with something like the following?</p>
  
  <pre><code>temp[grepl("UTC",datetimezone)] &lt;- as.POSIXct(datetimezone, tz="UTC")
  temp[grepl("PDT",datetimezone)] &lt;- as.POSIXct(datetimezone, tz="America/Los_Angeles")
  </code></pre>