Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

show datetime in local time zone #215

Open
FatFeng opened this issue May 26, 2017 · 0 comments
Open

show datetime in local time zone #215

FatFeng opened this issue May 26, 2017 · 0 comments

Comments

@FatFeng
Copy link

FatFeng commented May 26, 2017

It looks like the rbokeh always plots the datetime in the UTC time zone. Could it be modified so that it can show in a local time zone as well?

For example:
x <- seq(as.POSIXct("2011-1-1 08:00", tz='Asia/Hong_Kong'), as.POSIXct("2011-1-10 08:30", tz='Asia/Hong_Kong'), len=1000)
y <- 1:1000 * 0.1 + rnorm(1000, sd=2)

The datetimes of the last 10 points are
> print(tail(x, 10)) # show last time points
[1] "2011-01-10 06:32:58 HKT" "2011-01-10 06:45:58 HKT" "2011-01-10 06:58:58 HKT" "2011-01-10 07:11:58 HKT" [5] "2011-01-10 07:24:59 HKT" "2011-01-10 07:37:59 HKT" "2011-01-10 07:50:59 HKT" "2011-01-10 08:03:59 HKT" [9] "2011-01-10 08:16:59 HKT" "2011-01-10 08:30:00 HKT"

We can see that all of them are on 2011-01-10, however, once we plot them, we will see
> figure() %>% rbokeh::ly_lines(tail(x, 10), tail(y, 10))
image
It looks like the x-axis tickers are shown in the UTC time zone instead of the Asia/Hong_Kong time zone.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant