title: Converting epoch to date and back to epoch
body: <p>There have been questions about this earlier also
  <a href="https://stackoverflow.com/questions/13456241/convert-unix-epoch-to-date-object-in-r">here</a>, <a href="https://stackoverflow.com/questions/27408131/convert-unix-timestamp-intto-datetime-in-r">here</a>, <a href="https://stackoverflow.com/questions/20910967/convert-date-to-unix-time-in-r">here</a>, <a href="https://stackoverflow.com/questions/18463988/in-r-how-to-convert-a-formatted-local-time-to-epoch">here</a></p>
  
  <p>Using all these info, below should have worked, but there seems some to be some translation loss.</p>
  
  <pre><code>a &lt;- c(1433097000, 1433183400, 1433269800, 1433356200, 1433442600, 1433529000)
  a
  # [1] 1433097000 1433183400 1433269800 1433356200 1433442600 1433529000
  b &lt;- as.Date(as.POSIXct(a, origin='1970-01-01', tz='Asia/Kolkata'))
  b &lt;- as.numeric(as.POSIXct(b, tz='Asia/Kolkata', format="%Y-%m-%d", origin='1970-01-01'))
  b
  # [1] 1433030400 1433116800 1433203200 1433289600 1433376000 1433462400
  </code></pre>
  
  <p>====
  Edit:</p>
  
  <p>With tz='Asia/Kolkata', time in <code>a</code> is coming as <code>00:00:00</code></p>
  
  <pre><code>strftime(as.POSIXct(a, origin='1970-01-01', tz='Asia/Kolkata'), format="%Y-%m-%d %H:%M:%S")
  [1] "2015-06-01 00:00:00" "2015-06-02 00:00:00" "2015-06-03 00:00:00" "2015-06-04 00:00:00" "2015-06-05 00:00:00"
  [6] "2015-06-06 00:00:00"
  </code></pre>
  
  <hr>