That strange 'T' happens to be specified as part of the ISO 8601 date and time standard. As such it is compatible with as.POSIXlt and as.POSIXct.

> as.POSIXlt('2013-01-10T00:00:00.000')
[1] "2013-01-10"

https://en.wikipedia.org/wiki/ISO_8601


On Jul 25, 2013, at 2:40 PM, Tim Meggs <twmeggs@gmail.com> wrote:

> Hi R finance people,
> 
> I have downloaded some 15-min price Bar data across a number of days from
> Bloomberg for the March13 FTSE futures. 
> 
> library(Rbbg)
> conn <- blpConnect()
> ftse <- "Z H3 Index"
> ftse_Bars <- bar(conn, ftse, "TRADE", "2013-01-04 07:00:00.000", "2013-02-01
> 20:00:00.000", "15")
> ftse_Bars<-as.xts(ftse_Bars)
> blpDisconnect(conn)
> 
> The data looks like this:
> 
>                                           time   open   high    low  close
> numEvents volume
> 2013-01-10T01:00:00.000 2013-01-10T01:00:00.000 6050.5 6050.5 6047.0 6048.0       
> 12     12
> 2013-01-10T01:15:00.000 2013-01-10T01:15:00.000 6046.5 6047.5 6046.5 6047.5        
> 2      2
> 2013-01-10T01:30:00.000 2013-01-10T01:30:00.000 6046.5 6046.5 6044.5 6045.0       
> 12     21
> 2013-01-10T01:45:00.000 2013-01-10T01:45:00.000 6044.5 6045.5 6044.5 6045.5        
> 6      9
> 2013-01-10T02:00:00.000 2013-01-10T02:00:00.000 6045.5 6049.0 6045.5 6047.5       
> 11     13
> 2013-01-10T02:15:00.000 2013-01-10T02:15:00.000 6053.0 6059.0 6049.0 6058.0       
> 37     68
> 
> I would like to remove those bars that fall outside the hours 07:00 UTC to
> 15:30 UTC, to leave me with data just from the hours when the cash index is
> open.  Given the time column I receive from Bloomberg is in the slightly odd
> format format "%Y-%m-%dT%H:%M:%S" with the strange "T" in the middle how can
> subset out my desired data?
> 
> Any help greatly appreciated.
> 
> Thanks
> Tim
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/subset-section-of-trading-day-from-RBloomberg-bar-download-tp4672338.html
> Sent from the Rmetrics mailing list archive at Nabble.com.
> 
> _______________________________________________
> R-SIG-Finance@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.


	[[alternative HTML version deleted]]

