It does not matter which package you use - it converts the date / datetime object to a POSIXct representation of seconds from the era. So you can also do this in the R database - so here deploy ISOdatetime() with an arbitrary day, using today:
R> difftime(ISOdatetime(2012,7,2,12,34,45), ISOdatetime(2012,7,2,0,0,0)) Time difference of 12.5792 hours
So we need seconds:
R> difftime(ISOdatetime(2012,7,2,12,34,45), ISOdatetime(2012,7,2,0,0,0), + unit="secs") Time difference of 45285 secs
And we can use for numbers:
R> as.numeric(difftime(ISOdatetime(2012,7,2,12,34,45), + ISOdatetime(2012,7,2,0,0,0), unit="secs")) [1] 45285
Edit: And returning to lubridate, this is possibly a mistake:
> hms("12:34:45") - hms("00:00:00") [1] 12 hours, 34 minutes and 45 seconds R> as.numeric(hms("12:34:45") - hms("00:00:00")) [1] 45 R>