Skip to content

fix: parse date_utc as UTC in formatLocalTime for correct timezone conversion#37

Closed
Clav3rbot wants to merge 1 commit intoadn8naiagent:devfrom
Clav3rbot:fix/timezone-local-time
Closed

fix: parse date_utc as UTC in formatLocalTime for correct timezone conversion#37
Clav3rbot wants to merge 1 commit intoadn8naiagent:devfrom
Clav3rbot:fix/timezone-local-time

Conversation

@Clav3rbot
Copy link
Copy Markdown
Contributor

What

Fixes formatLocalTime in SessionPicker.tsx to correctly parse date_utc timestamps as UTC before converting to the user's local timezone.

Why

Session timestamps from the backend arrive as UTC strings (format YYYY-MM-DD HH:mm:ss) but were being parsed without explicit UTC designation, causing them to be interpreted as local time. This resulted in incorrect session times displayed to users in non-UTC timezones.

How

  • Appends Z suffix to date_utc strings before passing to Date constructor so the browser correctly interprets them as UTC.
  • Local time formatting then correctly converts from UTC to the user's timezone.

…nversion

The date_utc field from FastF1 arrives as '2026-03-15 03:00:00' without a
timezone suffix. JavaScript's Date constructor treats this as local time,
so sessions were displayed with wrong times.

Appends 'Z' (or converts space to 'T' + 'Z') so the string is parsed as
UTC before converting to the user's local timezone.
@adn8naiagent
Copy link
Copy Markdown
Owner

Have restyled the times to show day and date and fixed time zone conversion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants