Displaying 1 result from an estimated 1 matches for "timedifferencetime".
2008 Oct 03
1
Problem with strptime
...umn with dates in the form %Y-%m-%d %H:%M:%S; I want to substract the line i+1 to the line i and get a numeric result (in seconds for instance).
This is what I did (I take the data from a database):
res<- dbSendQuery (con, "SELECT Date_Heure FROM data.meteo ")Time<-fetch(res, n=-1)TimeDifferencetime<-as.numeric(diff(strptime(Time, format='%Y-%m-%d %H:%M:%S')) )
Differencetime
The colum Time is ok, I get something like (~20 000 values):
...
13199 2008-03-19 03:55:4613200 2008-03-19 04:00:4613201 2008-03-19 04:05:4613202 2008-03-19 04:10:4613203 2008-03-19 04:15:46
...
But for D...