Duration in seconds the session lasts i have a dataframe contain session start and end time 

&gt; data %&gt;% group_by(SessionID) %&gt;% summarise(start_time = min(Timestamp), end_time =max(Timestamp), unique_items=length(unique(ItemID)))
# A tibble: 1,815 x 4
   SessionID start_time              end_time                unique_items
       &lt;int&gt; &lt;dttm&gt;                  &lt;dttm&gt;                         &lt;int&gt;
 1        11 2014-04-03 11:04:11.417 2014-04-03 11:04:18.096            1
 2        12 2014-04-02 10:42:17.226 2014-04-02 10:42:17.226            1
 3        21 2014-04-07 09:24:18.306 2014-04-07 09:24:18.359            2
 4        22 2014-04-06 01:47:51.888 2014-04-06 01:47:51.888            1
 5        26 2014-04-06 16:44:58.482 2014-04-06 16:44:58.482            1
 6        33 2014-04-06 18:24:51.206 2014-04-06 18:24:51.426            3
 7        46 2014-04-03 06:07:19.921 2014-04-03 07:09:22.750            1
 8        87 2014-04-07 06:47:34.388 2014-04-07 06:57:22.802            8
 9       103 2014-04-03 14:26:27.706 2014-04-03 14:26:27.706            1
10       104 2014-04-07 18:31:45.755 2014-04-07 18:31:45.755            1


i want to convert da session end time to seconds and display result like this

    &gt; result
    # A tibble: 1,815 x 2
   SessionID       end_time                   session end_time in seconds               
   &lt;int&gt;           &lt;dttm&gt;                 
     1        11 2014-04-03 11:04:18.096
     2        12 2014-04-02 10:42:17.226
     3        21 2014-04-07 09:24:18.359
     4        22 2014-04-06 01:47:51.888
     5        26 2014-04-06 16:44:58.482
     6        33 2014-04-06 18:24:51.426
     7        46 2014-04-03 07:09:22.750
     8        87 2014-04-07 06:57:22.802
     9       103 2014-04-03 14:26:27.706
    10       104 2014-04-07 18:31:45.755
    # ... with 1,805 more rows


and display duration in seconds the session lasts

thanks
If you want to get the time duration between the start and end in seconds, you can try this : 

data %&gt;% group_by(SessionID) %&gt;% 
summarise(start_time = min(Timestamp), end_time =max(Timestamp)) %&gt;% # using your code until here
mutate(`session end_time in seconds` = as.numeric(difftime(end_time, start_time, units = "secs"))) # gives the time interval in seconds