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

set icaltimetype::zone on create/conversion #571

Open
mcrha opened this issue May 11, 2022 · 0 comments
Open

set icaltimetype::zone on create/conversion #571

mcrha opened this issue May 11, 2022 · 0 comments

Comments

@mcrha
Copy link
Contributor

mcrha commented May 11, 2022

I've been fooled with the icaltimetype::zone requirement once again, specifically when comparing two times in different zones. As I want to compare the even time with the current time, I create the now as icaltimetype now = icaltime_current_time_with_zone(my_zone); and then I compare it to another icaltimetype, which is in another zone.

Problems:

  • the now.zone is set to UTC, not to the my_zone
  • due to that, the icaltime_compare() converts the time to the my_zone again, causing wrong time comparison.

Having set a wrong icaltimetype::zone is not always a problem (like when the converted time is only used to read the values back is okay), only those routines which expect it to be populated properly can misbehave, when the zone is not updated.

This patch changes the behaviour, but I do not propose it as a pull request, because it has important side effects, which may or may not be a problem.

It's also possible there are more functions to be updated, to set the icaltimetype::zone properly after conversion.

What do you think?

gnomesysadmins pushed a commit to GNOME/evolution that referenced this issue May 11, 2022
Without having set correct time zone for the ICalTime the conversion
routines can convert time twice into the destination time zone,
which causes wrong time. It could be seen also when comparing
the current time with the component time.

Related to libical/libical#571
gnomesysadmins pushed a commit to GNOME/evolution that referenced this issue May 11, 2022
Without having set correct time zone for the ICalTime the conversion
routines can convert time twice into the destination time zone,
which causes wrong time. It could be seen also when comparing
the current time with the component time.

Related to libical/libical#571
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