Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create convinient way to set time-zone #60

Open
iMissile opened this issue Apr 26, 2018 · 1 comment
Open

Create convinient way to set time-zone #60

iMissile opened this issue Apr 26, 2018 · 1 comment

Comments

@iMissile
Copy link

I try to create tibbletime through as_tibble_time with dates in local time-zone.
More specifcally, i have time "2018-04-06 08 MSK". ymd_h("2018-04-06 08", tz="Europe/Moscow")

During coercion internal index timezone was set as "UTC". All other functions will work in incorrect way (time shift). It's ctritical for business to support timezone correctly

@iMissile
Copy link
Author

I tried to reproduce issue and see that function filter_time did what I suppose, but it works not in obvious way. It's difficult to assume the timezone of filter_time expression. local\UTC?
How it will be calculated at another computer?
Could you add tz param for filter_time?

sample:

> d_df <- tibble(timestamp=c(ymd_h("2018-04-06 08", tz="Europe/Moscow"), ymd_hm("2018-04-06 23:59", tz="Europe/Moscow")))
> dput(d_df)
structure(list(timestamp = structure(c(1522990800, 1523048340
), class = c("POSIXct", "POSIXt"), tzone = "Europe/Moscow")), row.names = c(NA, 
-2L), class = c("tbl_df", "tbl", "data.frame"))
> 
> t_df <- as_tbl_time(d_df, index=timestamp)
> dput(t_df)
structure(list(timestamp = structure(c(1522990800, 1523048340
), class = c("POSIXct", "POSIXt"), tzone = "Europe/Moscow")), row.names = c(NA, 
-2L), class = c("tbl_time", "tbl_df", "tbl", "data.frame"), index_quo = ~timestamp, index_time_zone = "Europe/Moscow")
> 
> filter_time(t_df, '2018-04-06 07:00' ~ '2018-04-06 23:58')
# A time tibble: 1 x 1
# Index: timestamp
  timestamp          
  <dttm>             
1 2018-04-06 08:00:00

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

No branches or pull requests

1 participant