Bug #13025

OAI requests do not convert local date/time information into UTC, leading to unexpected results

Added by Dan Gillean about 1 year ago. Updated 2 months ago.

Status:VerifiedStart date:05/14/2019
Priority:MediumDue date:
Assignee:-% Done:


Target version:Release 2.6.0
Google Code Legacy ID: Tested version:2.4, 2.5
Sponsored:No Requires documentation:


First reported by a community user via GitHub - see: https://github.com/artefactual/atom/issues/893

From the user:

I recently came to discover that the arOaiPlugin does not convert between UTC and local time. When one uses the from and until url parameters with oai, the result will be requested from the database exactly as it was sent to Atom, where it should be converted to local time first.

Example of current behaviour (omitting dates for clarity);

I modify an object at 20:00 AEST (+10).
I make an oai request with from=09:30&until=10:30
No results are returned
I make an oai request with from=19:30&until=20:30.
OAI returns the object with the a timestamp of 10:00

Since the OAI standard dictates that all date/times are to be in UTC, the above results are incorrect and should look more like below:

I modify an object at 20:00 AEST.
I make an oai request with from=09:30&until=10:30
OAI returns the object with a timestamp of 10:00.

A solution I have put in place was to modify the setUpdateParametersFromRequest within arOaiPluginComponent.class.php. I simply run strtotime on $request->from and $request->until and this converts the date/time to my local timezone, ready to be looked up in the database.


#1 Updated by Dan Gillean about 1 year ago

  • Status changed from New to QA/Review
  • Target version set to Release 2.6.0

Fix for this issue submitted via community pull request from rferris: https://github.com/artefactual/atom/pull/896

Merged into qa/2.6.x and ready for QA testing.

#2 Updated by Dan Gillean 10 months ago

  • Status changed from QA/Review to Verified


#3 Updated by Dan Gillean 10 months ago

The ListIdentifiers verb in the documentation includes an example of using from and until time-based parameters in a request. We should add a note there, with an example, about using local time and having that convert to UTC.

See: https://www.accesstomemory.org/en/docs/2.5/user-manual/import-export/oai-pmh/#list-identifiers

#4 Updated by Dan Gillean 2 months ago

  • % Done changed from 0 to 100
  • Requires documentation deleted (Yes)

Also available in: Atom PDF