title: In lubridate, is there a way to convert a ymd_hms() date format to numeric and then back?
body: <p>Currently, I have date data stored in the column of a large data.table table. The date data look something like:</p>
  
  <pre><code>dt1 &lt;- data.table(Person = seq(6), Date = ymd_hms(c("2007-1-1 12:31:25 PST", "2007-1-3 09:31:25 PST", "2007-1-9 15:31:22 PST", "2007-1-17 21:41:23 PST", "2007-1-30 02:04:22 PST", "2007-2-2 02:07:12 PST")))
  
  &gt; dt1
  Person                Date
  1:      1 2007-01-01 12:31:25
  2:      2 2007-01-03 09:31:25
  3:      3 2007-01-09 15:31:22
  4:      4 2007-01-17 21:41:23
  5:      5 2007-01-30 02:04:22
  6:      6 2007-02-02 02:07:12
  </code></pre>
  
  <p>ymd_hms() is a function in the package <code>lubridate</code>. Now, when I convert the dates to numeric as so, I get:</p>
  
  <pre><code>dt1[,Date:=as.numeric(Date)]
  
  &gt; dt1
  Person       Date
  1:      1 1167654685
  2:      2 1167816685
  3:      3 1168356682
  4:      4 1169070083
  5:      5 1170122662
  6:      6 1170382032
  </code></pre>
  
  <p>After this, I have tried various methods but have been unable to convert the dates back to the original format. Would anyone know of a simple function? Thank you!</p>