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

as_datetime() doesn’t really respect tz for character objects #527

Closed
huftis opened this issue Mar 15, 2017 · 1 comment
Closed

as_datetime() doesn’t really respect tz for character objects #527

huftis opened this issue Mar 15, 2017 · 1 comment

Comments

@huftis
Copy link

huftis commented Mar 15, 2017

The as_datetime() function doesn’t work as expected for character objects.

Expected behaviour: The datetime string should be interpreted as a datetime in the chosen time zone tz (UTC by default).

Actual behaviour: The datetime string is interpreted as a datetime in the current time zone (including any DST-specific stuff) and then converted to the tz timezone.

Example (as run in the CET time zone):

> as_datetime("2015-01-04 03:10:00")
[1] "2015-01-04 02:10:00 UTC"
> as_datetime("2015-01-04 03:10:00", tz="UTC")
[1] "2015-01-04 02:10:00 UTC"

Note that the time part is an hour off. Expected result:

[1] "2015-01-04 03:10:00 UTC"
@vspinu
Copy link
Member

vspinu commented May 7, 2017

Duplicated by #536 and fixed in cctz branch.

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

2 participants