data4development / IATI-data-validator

GNU Affero General Public License v3.0
5 stars 6 forks source link

time zone #75

Closed cgarboni closed 4 years ago

cgarboni commented 4 years ago

Describe the bug When checking a newly created XML on the test-validator.iatistandard.org, the error: "The last-updated-datetime of the organisation must not be in the future" occurs. This is just because, probably the time is tested agains GMT time.

To Reproduce Steps to reproduce the behavior:

  1. create an IATI XML file
  2. test it within the hour (CET time) and you get the error mentioned above. One hour later the error disapears.

Expected behavior not shown as an error.

Desktop (please complete the following information):

PetyaKangalova commented 4 years ago

@cgarboni thank you for your feedback and apologies for the delay in responding. Would you be able to add a screenshot of the error? Are you using the "Check data"?

In the meantime, @rolfkleef , can we check how the test is set for the "last-updated-datetime" ?

rolfkleef commented 4 years ago

The validator runs on UTC. If a publisher does not include timezone information in the last-updated-datetime value, the value is assumed to be in the timezone of the validator.

I've added tests to the ruleset to verify this: https://github.com/data4development/IATI-Rulesets/commit/0918b6e5af15181e68386b5c8c5afc0b48a4fe29

PetyaKangalova commented 4 years ago

Thanks @rolfkleef for adding the additional test on timezone. I don't think many organisations specify timezone in their file and I am not sure how best to test this. The rule in IATI refers to the date, which is key here. Can we briefly speak about the test you have added this afternoon?

@last-updated-datetime
The last date/time that the data for this specific activity was updated. This date must change whenever the value of any field changes.
This value must be of type xsd:dateTime.
@last-updated-datetime must not be more recent than the current date
PetyaKangalova commented 4 years ago

Tested with the below and happy for additional checks on timezone to remain. Tests are in line with current IATI rules. As organisations use the validator it will be good to hear their feedback and how often timezones are specified in the XML file.

<?xml version="1.0" encoding="utf-8"?>
       <iati-activities version="2.03" generated-datetime="2020-02-20T02:21:36">
       <iati-activity last-updated-datetime=""2020-05-18T14:49+01:00""