> time1 = strptime("2010-03-01 00:15:00", format = "%Y-%m-%d %H:%M:%S")
> time2a = strptime("2010-03-01", format = "%Y-%m-%d")
> time2b = as.Date(time2a)
> difftime(time1, time2a)
Time difference of 15 mins
> difftime(time1, time2b)
Time difference of 5.25 hours
From the help page of difftime, date object (time2b) is accepted. Why is the result wrong (5.25 hours)?
Thank you.
The first thing
difftimedoes is check for the tz argument. If missing it uses:testing that:
So it applies my timezone offset to the
dateobject.