0

So this isn't so much a coding question, but an understanding of this function within R. Lets pretend that I am subtracting a known data and time from just a date with unknown time. What is the default time Sys.time() uses in R?

example: endpoint (known time and date) - startpoint (known date)

The reason I ask is that I have a code, which I have been using. If it is a few hours off in every point, it won't make any difference in my data, but I want to know for myself.

shadow
  • 21,823
  • 4
  • 63
  • 77
user3919708
  • 141
  • 1
  • 1
  • 9
  • 2
    Did you look at `?Sys.time`? – GSee Oct 09 '14 at 14:15
  • Can you provide a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)? What are the classes of your `startpoint` and `endpoint` variables? – shadow Oct 09 '14 at 14:16
  • 1
    Is your known date an object of the `Date` class? If so you could execute e.g. `Sys.time()-(Sys.Date()-1)` and see the warning message. – nrussell Oct 09 '14 at 14:16
  • @GSee, that was the first thing I did and cant find anything that makes sense to me, and @ shadow sure endpoint<- "2014-10-09 09:28:06 CDT", startpoint <- "2014-09-23 CDT"; thus, "2014-10-09 09:28:06 - "2014-09-23 CDT" = 363 hours – user3919708 Oct 09 '14 at 14:19
  • @nrussell this is what I was trying to find, it appears to use 5:19am CDT for unknown times – user3919708 Oct 09 '14 at 14:43
  • From `?as.POSIXct` - _"Dates without times are treated as being at midnight UTC"_ – hrbrmstr Oct 09 '14 at 14:48
  • @ hrbrmstr, this can cant be. look up a few lines and you will see that what your wrote cant be what my answer is. – user3919708 Oct 09 '14 at 15:15

0 Answers0