{"action":"created","issue":{"url":"https://api.github.com/repos/tidyverts/tsibble/issues/70","repository_url":"https://api.github.com/repos/tidyverts/tsibble","labels_url":"https://api.github.com/repos/tidyverts/tsibble/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/tidyverts/tsibble/issues/70/comments","events_url":"https://api.github.com/repos/tidyverts/tsibble/issues/70/events","html_url":"https://github.com/tidyverts/tsibble/issues/70","id":381425074,"node_id":"MDU6SXNzdWUzODE0MjUwNzQ=","number":70,"title":"handling daylight savings","user":{"login":"earowang","id":2456216,"node_id":"MDQ6VXNlcjI0NTYyMTY=","avatar_url":"https://avatars0.githubusercontent.com/u/2456216?v=4","gravatar_id":"","url":"https://api.github.com/users/earowang","html_url":"https://github.com/earowang","followers_url":"https://api.github.com/users/earowang/followers","following_url":"https://api.github.com/users/earowang/following{/other_user}","gists_url":"https://api.github.com/users/earowang/gists{/gist_id}","starred_url":"https://api.github.com/users/earowang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/earowang/subscriptions","organizations_url":"https://api.github.com/users/earowang/orgs","repos_url":"https://api.github.com/users/earowang/repos","events_url":"https://api.github.com/users/earowang/events{/privacy}","received_events_url":"https://api.github.com/users/earowang/received_events","type":"User","site_admin":false},"labels":[{"id":1021624490,"node_id":"MDU6TGFiZWwxMDIxNjI0NDkw","url":"https://api.github.com/repos/tidyverts/tsibble/labels/help%20wanted","name":"help wanted","color":"8142a5","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-16T02:54:28Z","updated_at":"2018-11-16T03:46:32Z","closed_at":null,"author_association":"MEMBER","body":"Switching from daylight savings to standard time gains an additional hour. But regarding the clock time, there's no change.\r\n\r\nWhich time interval is (supposedly) correct? It perhaps depends on the data context. Either may have its own reasoning.\r\n\r\n``` r\r\nlibrary(lubridate)\r\nx <- ymd_h(\"2015-04-05 00\", tz = \"Australia/Melbourne\") + hours(c(0, 3, 6, 9))\r\nx\r\n#> [1] \"2015-04-05 00:00:00 AEDT\" \"2015-04-05 03:00:00 AEST\"\r\n#> [3] \"2015-04-05 06:00:00 AEST\" \"2015-04-05 09:00:00 AEST\"\r\ndiff(x)\r\n#> Time differences in hours\r\n#> [1] 4 3 3\r\ntsibble::pull_interval(x)\r\n#> 1h\r\ny <- force_tz(x, \"UTC\")\r\ny\r\n#> [1] \"2015-04-05 00:00:00 UTC\" \"2015-04-05 03:00:00 UTC\"\r\n#> [3] \"2015-04-05 06:00:00 UTC\" \"2015-04-05 09:00:00 UTC\"\r\ndiff(y)\r\n#> Time differences in hours\r\n#> [1] 3 3 3\r\ntsibble::pull_interval(y)\r\n#> 3h\r\n```\r\n\r\nWorth highlighting daylight savings in tsibble using `*`?\r\n\r\n``` r\r\ntsibble::pedestrian\r\n#> # A tsibble: 66,037 x 5 [1h*]\r\n#> # Key:       Sensor [4]\r\n#>    Sensor         Date_Time           Date        Time Count\r\n#>    <chr>          <dttm>              <date>     <int> <int>\r\n#>  1 Birrarung Marr 2015-01-01 00:00:00 2015-01-01     0  1630\r\n#>  2 Birrarung Marr 2015-01-01 01:00:00 2015-01-01     1   826\r\n#>  3 Birrarung Marr 2015-01-01 02:00:00 2015-01-01     2   567\r\n#>  4 Birrarung Marr 2015-01-01 03:00:00 2015-01-01     3   264\r\n#>  5 Birrarung Marr 2015-01-01 04:00:00 2015-01-01     4   139\r\n#>  6 Birrarung Marr 2015-01-01 05:00:00 2015-01-01     5    77\r\n#>  7 Birrarung Marr 2015-01-01 06:00:00 2015-01-01     6    44\r\n#>  8 Birrarung Marr 2015-01-01 07:00:00 2015-01-01     7    56\r\n#>  9 Birrarung Marr 2015-01-01 08:00:00 2015-01-01     8   113\r\n#> 10 Birrarung Marr 2015-01-01 09:00:00 2015-01-01     9   166\r\n#> # … with 66,027 more rows\r\n```\r\n\r\nCan you provide some thoughts on this? @dicook @robjhyndman @mitchelloharawild "},"comment":{"url":"https://api.github.com/repos/tidyverts/tsibble/issues/comments/439273029","html_url":"https://github.com/tidyverts/tsibble/issues/70#issuecomment-439273029","issue_url":"https://api.github.com/repos/tidyverts/tsibble/issues/70","id":439273029,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTI3MzAyOQ==","user":{"login":"earowang","id":2456216,"node_id":"MDQ6VXNlcjI0NTYyMTY=","avatar_url":"https://avatars0.githubusercontent.com/u/2456216?v=4","gravatar_id":"","url":"https://api.github.com/users/earowang","html_url":"https://github.com/earowang","followers_url":"https://api.github.com/users/earowang/followers","following_url":"https://api.github.com/users/earowang/following{/other_user}","gists_url":"https://api.github.com/users/earowang/gists{/gist_id}","starred_url":"https://api.github.com/users/earowang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/earowang/subscriptions","organizations_url":"https://api.github.com/users/earowang/orgs","repos_url":"https://api.github.com/users/earowang/repos","events_url":"https://api.github.com/users/earowang/events{/privacy}","received_events_url":"https://api.github.com/users/earowang/received_events","type":"User","site_admin":false},"created_at":"2018-11-16T03:46:32Z","updated_at":"2018-11-16T03:46:32Z","author_association":"MEMBER","body":"Thanks. Parsing date-times is done with **lubridate**, particularly importing data. Daylight savings is a tricky issue and OS specific. The current **tsibble** implementation respects time zone, using `base::seq()` to take care of time zone. Probably a new vignette \"FAQ\" needs to explain how tsibble handles DST and leave the decision to users.\r\n\r\n``` r\r\nlibrary(tsibble)\r\nx <- as.POSIXct(\"2015-04-05 01:00:00\", format =  \"%Y-%m-%d %H:%M:%S\", tz = \"Australia/Melbourne\")\r\nx1 <- x + (c(0, 3, 6, 9))*60*60\r\ntsibble(date = x1)\r\n#> Column `date` is the index.\r\n#> # A tsibble: 4 x 1 [3h]\r\n#>   date               \r\n#>   <dttm>             \r\n#> 1 2015-04-05 01:00:00\r\n#> 2 2015-04-05 03:00:00\r\n#> 3 2015-04-05 06:00:00\r\n#> 4 2015-04-05 09:00:00\r\ntsibble(date = x1) %>% fill_na()\r\n#> Column `date` is the index.\r\n#> # A tsibble: 4 x 1 [3h]\r\n#>   date               \r\n#>   <dttm>             \r\n#> 1 2015-04-05 01:00:00\r\n#> 2 2015-04-05 03:00:00\r\n#> 3 2015-04-05 06:00:00\r\n#> 4 2015-04-05 09:00:00\r\ntime_in(x1, ~ \"2015-04-05 02\")\r\n#> [1]  TRUE FALSE FALSE FALSE\r\ntime_in(x1, ~ \"2015-04-05 03\")\r\n#> [1]  TRUE  TRUE FALSE FALSE\r\n```\r\n\r\n<sup>Created on 2018-11-16 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)</sup>"}}
{"actor":{"display_login":"earowang"}}