Dates off by a day? Check the time zone

Your site shows the right dates when you test it. Then a customer in New York says their booking shows yesterday's date, a "posted today" label says "posted tomorrow", or a daily reminder fires at 3am. Nothing changed in your code. The difference is where the code runs. On your laptop, dates are worked out in your own time zone. On the live site, part of the work happens on a server or in a database that usually runs in UTC, and part happens in each visitor's browser in their own time zone. Sites built with Lovable, Bolt, Replit, v0 or Cursor hit this a lot, because the generated code mixes all three places without saying so.

The symptom

  • Dates are one day early or late for some users, usually those far east or west of you.
  • Times are off by a whole number of hours, often your own offset from UTC.
  • Scheduled jobs, daily emails or "resets at midnight" features run at the wrong hour.
  • On server-rendered pages (for example Next.js), you see a hydration warning, or a date flickers and changes after the page loads.
  • Things shift by an hour twice a year, when daylight saving time starts or ends.

The cause

There are a few common culprits, and one site can have several.

  • Date-only strings parsed as UTC. In JavaScript, new Date("2026-11-04") is read as midnight UTC. Shown to someone in California, that is the evening of 3 November. A birthday or due date saved as a plain date can slip back a day.
  • The server's clock is in UTC. Hosted servers and serverless functions normally run in UTC. Code that builds "today" or "midnight" on the server gets UTC's today, not the user's.
  • Database columns without a time zone. In Postgres (which Supabase uses), a timestamp column stores no time zone, while timestamptz stores an exact moment. Mixing them, or saving local times into a plain timestamp, makes values ambiguous.
  • Schedulers use UTC. Cron schedules on many hosts and in database schedulers are read as UTC unless you set otherwise, so "9am" means 9am UTC.
  • Server and browser format differently. When the server renders a date in UTC and the browser re-renders it in local time, the two don't match.

Step-by-step diagnosis

  1. Reproduce it in another time zone. In Chrome DevTools, open the Sensors panel and override the location or time zone, or change your computer's time zone, then reload the live site. If dates shift, you've found a time zone bug.
  2. Find where the date is made. Search the code for new Date(, toLocaleDateString, toISOString and date libraries. Note whether each runs in the browser, a server function or the database.
  3. Look at the raw value. Check what the database row or API response actually contains. A value ending in Z or +00:00 is UTC. A bare 2026-11-04 09:00:00 has no zone, which is the risky kind.
  4. Check column types. In your database's table editor, see whether time columns are timestamp or timestamptz, and whether pure dates are stored as date.
  5. Check the scheduler. Read your host's or database's cron documentation to see which time zone schedules use.

Fixes per builder or host

The general rule

Store exact moments in UTC, and convert to the user's time zone only when you display them. Store calendar dates that have no time, like a birthday, as plain dates, and don't turn them into Date objects at midnight UTC. Format them as text instead.

Supabase (common with Lovable and Bolt)

Use timestamptz for created, updated and scheduled times, and date for date-only fields. If a column is already a plain timestamp, ask your builder to migrate it carefully and back up the data first. For a schedule meant to run in local time, work out the UTC equivalent and remember it moves when daylight saving changes.

Next.js on Vercel (common with v0 and Cursor)

For server-rendered dates, either pass an explicit timeZone to Intl.DateTimeFormat so server and browser agree, or render user-facing local times only in the browser. Vercel cron schedules are written in UTC, so convert your target hour.

Replit and Node servers

Don't rely on the machine's time zone. Pass the user's time zone explicitly, which you can get in the browser with Intl.DateTimeFormat().resolvedOptions().timeZone and save on their profile.

How to verify

  • Set your browser to a time zone well behind UTC (Los Angeles) and one well ahead (Tokyo), and check the same record in both.
  • Create a record late in the evening local time and confirm it shows the right day.
  • Check a scheduled job's next run time against what you expect in UTC.
  • Reload server-rendered pages and watch for dates that change after load.

Prevention

  • Pick one rule for the whole site: UTC in storage, local time on screen.
  • Test with at least one far-away time zone before every launch.
  • Put a calendar reminder near daylight saving changes to check anything scheduled.
  • Keep time zone handling in one helper so every page formats dates the same way.

Run the free 30-second check

Run the free 30-second check

← All posts

FlowCanary on SaaSHub