Time Zone 'Central Standard Time (Mexico)' dont work properly

Gerardo García Calva 25 Reputation points
2023-04-02T20:50:12.1933333+00:00

Time Zone 'Central Standard Time (Mexico)' dont work properly on Azure Functions, Azure Web App, Azure SQL

Azure SQL Database
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,381 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,032 questions
{count} votes

2 answers

Sort by: Most helpful
  1. VenkateshDodda-MSFT 19,061 Reputation points Microsoft Employee
    2023-04-03T06:50:32.5033333+00:00

    @Gerardo García Calva Thank you for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    Our engineering team has confirmed that this is a known issue and they have created an fix for windows os and this fix will be rolled out to the customers in their next release(No ETA at the moment).

    At this moment the workaround to use custom TimeZoneInfo functionality in .NET.

    For information, you can refer to this blog post for which windows operating systems this Mexico 2023 times updates are avaialable.

    1 person found this answer helpful.

  2. Rubio Hernandez Andres 0 Reputation points
    2023-04-04T01:16:06.53+00:00

    Hello @Gerardo Garcia Calva Until the fix arrive you can do this:

    public static readonly Lazy<TimeZoneInfo> LazyMexicoTimeZoneInfo = new Lazy<TimeZoneInfo>(
                () =>
                {   
                    const string displayName = "(GMT-06:00) México Tiempo del Centro";
                    const string standardName = "México Tiempo del Centro (Horario de Siempre)";
                    
                    var offset = new TimeSpan(-6, 0, 0);
                    var result = TimeZoneInfo.CreateCustomTimeZone(standardName, offset, displayName, standardName, null, null);
    
                    return result;
                });
    
    0 comments No comments