[R] difference between date and times

Ista Zahn istazahn at gmail.com
Tue Feb 23 17:24:41 CET 2010


Hi Karine,

time1 <- as.POSIXct("2007-02-21 05:19:00")
time2 <- as.POSIXct("2007-02-20 14:21:53")
difftime(time1, time2)

should get you started.

-Ista


On Tue, Feb 23, 2010 at 9:48 AM, karine heerah <karine.heerah at hotmail.fr> wrote:
>
> Hi,
>
>
>
> I have date and time in a format like this: " 2007-02-21 05:19:00".
>
> Do you which function i can use to derterminate the difference in time between this value and an other one.
>
> For exemple:
>
>
>
> this one : 2007-02-21 05:19:00
>
> and this one : 2007-02-20 14:21:53
>
>
>
> Thanks a lot,
>
> Karine H.
>
>
>
>
>
>
> _________________________________________________________________
> [[elided Hotmail spam]]
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org



More information about the R-help mailing list