Parse OXR timestamps in UTC #2

Open
bsturmfels wants to merge 1 commit from utc-timestamps into master
Member

I noticed that in my Australia/Melbourne (UTC +10/+11) timezone, a request for "2026-09-01"
was being cached as "2026-09-02_USD_rates.json" (1 day late). Subsequent requests would
re-request from the internet, rather than cache, or if the previous day had been cached,
used that.

In practise, this would never be an issue in America/New_York (UTC -5/-4), since the "1
second before midnight UTC" timestamp returned by OXR is always the same date.

The OXR timestamp is in UTC though, so I've updated deserialize_timestamp
accordingly.

I noticed that in my Australia/Melbourne (UTC +10/+11) timezone, a request for "2026-09-01" was being cached as "2026-09-02_USD_rates.json" (1 day late). Subsequent requests would re-request from the internet, rather than cache, or if the previous day had been cached, used that. In practise, this would never be an issue in America/New_York (UTC -5/-4), since the "1 second before midnight UTC" timestamp returned by OXR is always the same date. The OXR timestamp *is* in UTC though, so I've updated `deserialize_timestamp` accordingly.
I noticed that in my Australia/Melbourne (UTC +10/+11) timezone, a request for "2026-09-01"
was being cached as "2026-09-02_USD_rates.json" (1 day late). Subsequent requests would
re-request from the internet, rather than cache, or if the previous day had been cached,
used that.

In practise, this would never be an issue in America/New_York (UTC -5/-4), since the "1
second before midnight UTC" timestamp returned by OXR is always the same date.

The OXR timestamp *is* in UTC though, so I've updated `deserialize_timestamp`
accordingly.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin utc-timestamps:utc-timestamps
git switch utc-timestamps

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff utc-timestamps
git switch utc-timestamps
git rebase master
git switch master
git merge --ff-only utc-timestamps
git switch utc-timestamps
git rebase master
git switch master
git merge --no-ff utc-timestamps
git switch master
git merge --squash utc-timestamps
git switch master
git merge --ff-only utc-timestamps
git switch master
git merge utc-timestamps
git push origin master
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
NPO-Accounting/oxrlib!2
No description provided.