[R] date calculation

Ben Bolker bbolker at gmail.com
Sat Oct 30 04:54:53 CEST 2010


Shi, Tao <shidaxia <at> yahoo.com> writes:

> Could someone explain to me why the following result is not a integer?
> 
> > difftime(strptime("24NOV2004", format="%d%b%Y"), strptime("13MAY2004", 
> >format="%d%b%Y"), units="days")
> Time difference of 195.0417 days

  Presumably because this goes across a daylight-savings time
adjustment?  0.0417=1/24 days is 1 hour ...

  Ben Bolker



More information about the R-help mailing list