Skip to main content

Timezone Handling

HostMetrics has a two-tier timezone system because trip data and toll data come from different sources with different timezone behaviors.

The Two Systems

1. Trip Data (UTC Storage)

When Turo CSV dates are inserted into PostgreSQL’s timestamptz columns, Postgres automatically converts them to UTC.

2. Toll Data (Local Storage)

Toll agencies report in their local timezone. Since the host is typically in the same timezone, the dates are already correct.

The Business Timezone Setting

In Settings > Data Sources, hosts configure their business timezone (e.g., America/Chicago). This is NOT the user’s browser timezone — it’s “what timezone is my business in.”

Trip-to-Toll Date Matching

When matching tolls to trips (for reconciliation), both dates are compared as YYYY-MM-DD strings:
This works because both represent the “local date” in the host’s market.

Critical Rule: Date Parsing

When parsing toll CSV dates, NEVER use toISOString():

Display Formatting

Key Files