Repository navigation
Set the API's time zone to Los Angeles for report dates - #63
Merged
Merged
Conversation
Cloud Run runs on UTC, so the "Report created on" date in API-built reports showed tomorrow's date after 7 pm Eastern. America/Los_Angeles matches the EJAM app's fallback time zone. Also installs tzdata so R can use the setting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ericnost
reviewed
Nov 11, 2026
ericnost
left a comment
Contributor
There was a problem hiding this comment.
Seems fine. I recall previously having a time zone setting (Chicago?) in the Dockerfile, not sure where it went. Users working late on the east coast will get the wrong timestamp, but it's unavoidable and not a huge deal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Report dates: use the Los Angeles time zone on the API server.
Reports built by the API say "Report created on " in the footer. That date comes from the server's clock, and Cloud Run runs on UTC, so a report made after 7 pm Eastern shows tomorrow's date. This was seen on 2026-11-10 with the v4.2024.0 test API: a report made in the evening, US time, said November 11.
The EJAM app's own reports already use the user's browser time zone, falling back to
America/Los_Angeles(EJAMR/app_server.R,date_in_user_timezone()). The API has no browser to ask, so this sets the same fallback for the whole API container.Changes (Dockerfile only):
ENV TZ=America/Los_Angeles, set before the system packages are installed.tzdatato the system packages, so R can use that setting. Without it, R stays on UTC.Effect: every mainland US user sees today's date until midnight in Los Angeles (3 am Eastern). Nothing else in the API depends on the time zone that I could find; logs on Cloud Run carry their own UTC timestamps.
Base branch:
version4-2024-0, so it can go into the v4 build. The same two lines would also suit the v3.2022.3 archive build.To check after a build: request any report as HTML in the evening, US time, and confirm the footer shows today's date. Or run
Sys.timezone()/format(Sys.time(), "%Z")in the container; it should report PST/PDT.Decided by the EJAM maintainer on 2026-11-10 (EJAM issue Public-Environmental-Data-Partners/EJAM#681, section C4). Not built or deployed by me.
— Claude (AI assistant), posting from ejanalysis account
🤖 Generated with Claude Code