Hi. I'm trying to take the difference in days between two times. Can you point out what's wrong, or suggest a different function? When I try the following code, The following code works fine:
a <- strptime(1911100807,format="%Y%m%d%H",tz="GMT") b <- strptime(1911102718,format="%Y%m%d%H",tz="GMT") x <- difftime(b, a, units="days") x But when I change the year, the following code returns 'NA' for the time between a and b. Thanks. a <- strptime(1999100807,format="%Y%m%d%H",tz="GMT") b <- strptime(1999102718,format="%Y%m%d%H",tz="GMT") x <- difftime(b, a, units="days") x ______________________________________________ R-help@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.