I’m downloading a tibble dataframe from the alphavantager R package. I’m trying to convert the timestamp column from the default Eastern timezone to UTC. All of my attempts leave the timestamp unchanged, except for putting the suffix “UTC” at the end in some of the attempts.
`
library(‘alphavantager’)
tst <- av_get(symbol = "NKE",
av_fun = "TIME_SERIES_INTRADAY",
interval = "15min",
extended_hours = "false",
month = "2024-03",
outputsize = "full")
# parsing out 1 day
tst<-tst[as.Date(tst$timestamp)=='2024-03-01',]
# attempt #1
tst$timestamp <- as.POSIXct(as.integer(tst$timestamp),tz="UTC")
# attempt #2
tst$timestamp <- as.POSIXct(as.integer(tst$timestamp), origin="1970-01-01", tz="UTC")
# attempt #3
tst<-as.data.frame(tst)
tst$timestamp <- as.POSIXct(as.integer(tst$timestamp),tz="UTC")
# attempt #4
tst <- as.list(tst)
tst$timestamp <- as.POSIXct(as.integer(tst$timestamp),tz="UTC")`