Thanks John. That was really helpful.

On 5/21/2013 8:54 AM, John Laing wrote:
> Nikos,
>
> There is limited date/time functionality built into Rbbg, but the 
> conversion you're seeking can be easily achieved using standard R 
> tools. You're already converting the data to xts, which has a 
> particularly convenient way of dealing with timezones. I would do 
> something like this, ignoring the milliseconds you added (which I 
> assume were just for formatting):
>
>
> require(xts)
> require(Rbbg)
> conn <- blpConnect()
>
> local.times <- as.POSIXct(c("2013-05-13 10:00:00", "2013-05-13 
> 10:15:00"), format="%Y-%m-%d %H:%M:%S")
> bbg.times <- strftime(local.times, "%Y-%m-%d %H:%M:%S.000", tz="UTC")
>
> bid <- tick(conn, "AAPL US Equity", "BID_BEST", bbg.times[1], 
> bbg.times[2])
> x <- xts(bid[, 3:4], strptime(bid$time, "%Y-%m-%dT%H:%M:%OS", "UTC"))
> tzone(x) <- NULL
>
>
>
> Hope that helps,
> John
>
>
> On Tue, May 21, 2013 at 1:33 AM, Nikos Rachmanis 
> <nikos.rachmanis@gmail.com <mailto:nikos.rachmanis@gmail.com>> wrote:
>
>     Hi all,
>
>     I have come across the following time zone problem and I would
>     appreciate your input.
>
>     I am trying to download tick data using the Rbloomberg and I have
>     found
>     out that the query should be done in "UTC" time zone. My current
>     zone is
>     "EST" so i have written the code below to transform it from "EST" to
>     "UTC" and works fine however the output i get is indicated in "UTC" as
>     listed below for my query (instead of 10:00:00.000).
>
>
>             time    type    value   size
>     1       2013-05-13T14:00:00.000         ASK_BEST  454.87  1
>     2       2013-05-13T14:00:00.000         TRADE   454.58  100
>     3       2013-05-13T14:00:00.000         ASK_BEST  454.78  10
>     4       2013-05-13T14:00:00.000         ASK_BEST  454.7   1
>     5       2013-05-13T14:00:00.000         TRADE   454.58  100
>     6       2013-05-13T14:00:00.000         ASK_BEST  454.7   1
>     7       2013-05-13T14:00:01.000         ASK_BEST  454.69  1
>
>
>     My questions are the the following:
>     1) Is there a way I could write the timezone transformation and
>     get the
>     correct timing or would I have to change after I download?
>     2) I have tried to use the xts constructor with the following command
>     but was not successful. Any idea how to separate the "T" in the time?
>     new<-xts(bid[,3:4],order.by
>     <http://order.by>=strptime(x=as.character(bid$time),format="%Y-%m-%d
>     %H:%M:%OS",tz="EST"))
>
>     Thank you all,
>
>     Nikos
>
>
>
>     #Rbloomberg Code
>     # Special options
>     options(warn=-1)
>     options(digits.secs = 3)
>     options(java.parameters = "-Xmx1000m")
>
>     # Import libraries
>     library(RODBC)
>     library(Rbbg)
>
>     #set time interval (transforms from 10:00:00.001 to 14:00:00.001)
>     start_time<-toString(format(as.POSIXct("2013-05-13 10:00:00.001",
>     tz="EST5EDT"), tz="UTC"))
>     end_time<-toString(format(as.POSIXct("2013-05-13 10:15:00.001",
>     tz="EST5EDT"), tz="UTC"))
>
>     # Connect to Bloomberg API
>     conn <-  blpConnect(log.level = "finest")
>
>     #Download command
>     data <- tick(conn, "AAPL US Equity",
>                   c("TRADE","BID_BEST","ASK_BEST"),
>                   start_date_time=start_time,
>                   end_date_time=end_time)
>
>             [[alternative HTML version deleted]]
>
>     _______________________________________________
>     R-SIG-Finance@r-project.org <mailto: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]]

