Skip to content

Timezone update #524

Open
Open
@xHenrySx

Description

@xHenrySx

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

Supabase Edge Functions (both deployed and running locally via Docker) incorrectly resolve the timezone America/Asuncion. The Date.prototype.toLocaleString() method (and likely other timezone-aware date operations) returns a time corresponding to UTC-4, whereas the official time zone for Paraguay is currently fixed at UTC-3 year-round. This suggests the underlying Deno runtime environment uses an outdated IANA timezone database (tzdata) that does not reflect Paraguay's recent legislative change.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Create a new Supabase Edge Function
  2. Replace the content with this example code:
    Deno.serve(async (req, connInfo) => {
      const now = new Date();
      const utcTimeString = now.toUTCString();
      
      // Get time using the problematic timezone
      const paraguayTimeString = now.toLocaleString("en-US", { timeZone: "America/Asuncion" });
    
      // Get time using a fixed UTC-3 offset for comparison (Note: Etc/GMT+3 means UTC-3)
      const expectedParaguayTimeString = now.toLocaleString("es-PY", { timeZone: "Etc/GMT+3" });
      const responsePayload = {
        currentTimeUTC: utcTimeString,
        reportedParaguayTime: paraguayTimeString, // This shows the incorrect time (based on UTC-4)
        expectedParaguayTime: expectedParaguayTimeString, // This shows the correct time (based on UTC-3)
        issue: "Reported Paraguay time does not match expected UTC-3 time."
      };
    
      console.log("Current Date Object:", now);
      console.log("Payload:", responsePayload);
    
      return new Response(
        JSON.stringify(responsePayload),
        { headers: { "Content-Type": "application/json" } }
      );
    })
  3. Serve the function locally.

Expected behavior

Calling new Date().toLocaleString("es-PY", { timeZone: "America/Asuncion" }) within a Supabase Edge Function should return a date/time string formatted according to Paraguay's current official time zone, which is permanently UTC-3

System information

  • OS: Linux
  • Version of supabase-js: 2.49.1
  • Version of supabase-cli: 2.20.5

Additional context

Paraguay passed Law N° 7115/2023, establishing UTC-3 ("Horario de Verano" / Paraguay Summer Time) as the standard time year-round, eliminating the previous annual switch to UTC-4 (Paraguay Time).

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-blocked-upstreamStatus: It has been blocked due to upstream issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions