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

Shouldn't dst() on a date return NA? #1181

Open
etiennebacher opened this issue Feb 10, 2025 · 0 comments
Open

Shouldn't dst() on a date return NA? #1181

etiennebacher opened this issue Feb 10, 2025 · 0 comments

Comments

@etiennebacher
Copy link

Hello, the docs of dst() say:

[returns] TRUE if DST is in force, FALSE if not, NA if unknown.

and

A date-time's daylight savings flag can not be set because it depends on the date-time's year, month, day, and hour values.

But the example in the docs shows what happens when the input is a date:

x <- ymd("2012-03-26")
dst(x)
#> [1] FALSE

To me the example contradicts the explanation. If a flag "cannot be set", shouldn't the output be NA?


Additionally, I think the examples could be improved to show an example of a datetime with TZ that returns FALSE and one that returns TRUE.

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