Consider this list of POSIXct dates:

```
times <- list(as.POSIXct(c("2012-07-26 00:30", "2012-07-26 6:20",
                           "2012-07-26 10:40", "2012-07-26 15:50")),
              as.POSIXct(c("2012-07-26 01:15", "2012-07-26 10:10",
                           "2012-07-26 15:15", "2012-07-26 18:50")),
              as.POSIXct(c("2012-07-26 00:35", "2012-07-26 15:05", 
                           "2012-07-26 19:36", "2012-07-26 22:32")),
              as.POSIXct(c("2012-07-26 03:34", "2012-07-26 16:43", 
                           "2012-07-26 21:44", "2012-07-26 23:45")))

```

If I do:

```
range(times[[1]])

```

I correctly get:

```
[1] "2012-07-26 00:30:00 CEST" "2012-07-26 15:50:00 CEST"

```

Now, if I do:

```
range(times[c(1,3)])

```

for whatever reason R decides to convert the POSIXct objects into timestamps and gives me

```
[1] 1343255400 1343334720

```

I then try to reconvert them to POSIXct by doing:

```
as.POSIXct(range(times[c(1,3)]), origin="1970-01-01 00:00")

```

And, strangely, I get the range with 1 hour of advance:

```
[1] "2012-07-25 23:30:00 CEST" "2012-07-26 21:32:00 CEST"

```

So I have to do:

```
as.POSIXct(range(times[c(1,3)]), origin="1970-01-01 01:00")

```

To get the correct range of:

```
[1] "2012-07-26 00:30:00 CEST" "2012-07-26 22:32:00 CEST"

```

Am I missing something or is there a bug somewhere?
['https://Stackoverflow.com/questions/11671135', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/176923/']
`times[[1]]` is a vector, while `times[c(1,3)]` is a list. Convert the latter to a vector before calling `range` and all is well.

You don't want to use `unlist` though, since it will only return an atomic vector (`range` must be doing something like that internally), but you can use `do.call`:

```
range(do.call(c,times[c(1,3)]))

```

The differences you get from using `as.POSIXct` are likely due to timezone issues.
As Joshua said, the hour is because of timezones. Try, for example:

```
times <- list(as.POSIXct(c("2012-07-26 00:30", "2012-07-26 6:20",
                       "2012-07-26 10:40", "2012-07-26 15:50"), "GMT"),
          as.POSIXct(c("2012-07-26 01:15", "2012-07-26 10:10",
                       "2012-07-26 15:15", "2012-07-26 18:50"), "GMT"),
          as.POSIXct(c("2012-07-26 00:35", "2012-07-26 15:05", 
                       "2012-07-26 19:36", "2012-07-26 22:32"), "GMT"),
          as.POSIXct(c("2012-07-26 03:34", "2012-07-26 16:43", 
                       "2012-07-26 21:44", "2012-07-26 23:45"), "GMT"))
as.POSIXct(range(times[c(1,3)]), origin="1970-01-01 00:00", "GMT")

```