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

Changeset - incorrect open status with timezone != utc-0 #150

Closed
mmd-osm opened this issue Jul 12, 2018 · 3 comments
Closed

Changeset - incorrect open status with timezone != utc-0 #150

mmd-osm opened this issue Jul 12, 2018 · 3 comments

Comments

@mmd-osm
Copy link
Collaborator

mmd-osm commented Jul 12, 2018

Situation: CGImap runs on a server in UTC+2 timezone. The changeset call /api/0.6/changeset/xxx returns a changeset where the status is "closed", although the changeset will only close 1 hour in the future. For further discussion see details at streetcomplete/StreetComplete#562 (comment)

now is initialized with local time (which is UTC+2):

pt::ptime now(pt::second_clock::local_time());

Comparison doesn't take UTC+2 / UTC+0 difference into account:

bool changeset_info::is_open_at(const pt::ptime &now) const {
const pt::ptime closed_at_time = parse_time(closed_at);
return (closed_at_time > now) && (num_changes < MAX_CHANGESET_ELEMENTS);
}

Processing should be based on UTC+0, regardless of the local timezone.

@tomhughes
Copy link
Contributor

Note that all OSM servers run in UTC all the time anyway.

@mmd-osm
Copy link
Collaborator Author

mmd-osm commented Jul 12, 2018

Right, I wanted to keep this in line with what we did here: openstreetmap/openstreetmap-website#1688, i.e. no hard requirement to run on UTC+0 timezone.

@tomhughes
Copy link
Contributor

So just change local_time to universal_time then ;-)

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