I can query an xts time range by using two time strings separated by "/":
library(xts)
set.seed(1234)
a = xts(1:10, as.POSIXlt(1366039619, tz="", origin="1970-01-01") + rnorm(10, 0, 3))
[,1]
2013-04-15 11:26:51.962906 4
2013-04-15 11:26:55.378802 1
2013-04-15 11:26:56.329886 10
2013-04-15 11:26:57.275780 7
2013-04-15 11:26:57.306643 9
2013-04-15 11:26:57.360104 8
2013-04-15 11:26:59.832287 2
2013-04-15 11:27:00.287374 5
2013-04-15 11:27:00.518167 6
2013-04-15 11:27:02.253323 3
> a['2013-04-15 11:26:57/2013-04-15 11:26:58']
[,1]
2013-04-15 11:26:57.275780 7
2013-04-15 11:26:57.306643 9
2013-04-15 11:26:57.360104 8
How can I run the same range query on a different xts object using the POSIXlt objects index(a[4]) and index(a[7])? Do I have to convert the indexes to strings or there is a faster way using integer values, like the number of secs since the epoch embedded in POSIXlt?