From 3451f11c5bc8a70e4046da9128052289158fb2fd Mon Sep 17 00:00:00 2001 From: pverspeelt Date: Mon, 8 Oct 2018 11:58:02 +0200 Subject: [PATCH] Fix getQuote.yahoo for multiple timezones When getQuote.yahoo was called it genereted errors when quotes from multiple timezones were involved. Fixed so everything is forced to the local timezone Fixes #246 --- R/getQuote.R | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/R/getQuote.R b/R/getQuote.R index 4783d04c..59005fde 100644 --- a/R/getQuote.R +++ b/R/getQuote.R @@ -68,14 +68,7 @@ function(Symbols,what=standardQuote(),...) { Qposix <- .POSIXct(sq[,"regularMarketTime"], tz=tz[1L]) } else { warning("symbols have different timezones; converting to local time") - convertTZ <- function(x) { - tz <- x$exchangeTimezoneName[1] - times <- .POSIXct(x$regularMarketTime, tz) - attr(times, "tzone") <- NULL - times - } - Qposix <- sapply(split(sq, sq$exchangeTimezoneName), convertTZ) - Qposix <- .POSIXct(Qposix, tz=NULL) # force local timezone + Qposix <- .POSIXct(sq$regularMarketTime, tz = NULL) # force local timezone } Symbols <- unlist(strsplit(Symbols,','))