[R] time difference (from date function)
jholtman at gmail.com
Wed Mar 18 17:24:36 CET 2009
If what you have is a character string, then convert it to POSIXlt and
 "Wed Mar 18 12:18:11 2009"
 "Wed Mar 18 12:18:18 2009"
> x1.c <- strptime(x1, "%a %b %d %H:%M:%S %Y")
> x2.c <- strptime(x2, "%a %b %d %H:%M:%S %Y")
> difftime(x2.c, x1.c, units='secs')
Time difference of 7 secs
On Wed, Mar 18, 2009 at 12:03 PM, milton ruser <milton.ruser at gmail.com> wrote:
> Dear all,
> I have two variables which contents are date() function answers, like:
> Now I need to compute the difference between d2 and d1 (in minutes).
> Any help are welcome.
> Best wishes
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
+1 513 646 9390
What is the problem that you are trying to solve?
More information about the R-help