posit-dev / posit-dev/connectapi
fix: timestamp parsing tests think they're changing the timezone but they aren't
@toph-allen is already working on this.
Since Jun 10, 2025.
- Dominant language
- R
- Stars
- 54
- Forks
- 27
- Avg merge
- 1d 3m
- Merged PRs (30d)
- 1
Description
According to ?Sys.timezone, the timezone is detected the first time it is needed and then cached for the rest of the R session. So setting TZ within the R process isn't actually effective.
% R
> Sys.timezone()
[1] "America/New_York"
> options(TZ="UTC")
> Sys.timezone()
[1] "America/New_York"
We missed that in the tests because we were asserting that the strings were being parsed according to Sys.timezone(), and we thought that was changing by setting TZ, but it wasn't.
It's probably not worth doing anything fancier to prove that we set different timezones, so we should probably just delete the duplicate tests that suggest that we can change the timezone and keep the ones that assert that we read in Sys.timezone().
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.