Forum Discussion

mattiarusso's avatar
mattiarusso
Icon for Advocate I rankAdvocate I
9 years ago
Solved

CRM API REST date time zone UTC issue

Hello Everybody,

I have a problem with the DateTimeZone in Power BI Service.

I retrieved a data/time field by CRM Online in Power BI Desktop by using CRM API REST. In Power BI Desktop the data/time field is the same in the CRM, but when i pubblished the report in Power BI Service, the API REST convert my date/time field in UTC time zone. I tried to convert the date in power query by using the function DateTimeZone.ToLocal([my date/time field] but the function convert my date in the UTC time zone,I think because the data is stored in Ireland (GMT Time, UTC +0) and I want to display data/time field in CET time zone (UTC +1) .
Someone could help me?

  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi mattiarusso,

     

    According to your description, you want to modify the utc timezone to your local timezone, right?

    If this is a case, you can use DateTimeZone.SwitchZone function or DateTime.AddZone function to achieve your requirement.

     

    Reference links:

    DateTimeZone.SwitchZone

    DateTime.AddZone

     

    Regards,

    Xiaoxin Sheng

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi mattiarusso,

     

    According to your description, you want to modify the utc timezone to your local timezone, right?

    If this is a case, you can use DateTimeZone.SwitchZone function or DateTime.AddZone function to achieve your requirement.

     

    Reference links:

    DateTimeZone.SwitchZone

    DateTime.AddZone

     

    Regards,

    Xiaoxin Sheng

    • mattiarusso's avatar
      mattiarusso
      Icon for Advocate I rankAdvocate I

      Thank you @v-shex-msft.

       

      What will happen when the time zone will change by CET (Central Europe Time [UTC +1])  to CEST (Central Europe Summer Time [UTC +2]). The function DateTimeZone.SwitchZone handles this datetime zone change?

       

       

      Thanks again

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi mattiarusso,

         

        Sorry for slow response, I think your datetime will transfer like below:

         

        UTC:  8:00 +0
        CET:  9:00 +1
        CEST: 10:00 +2

         

         

        Regards,

        Xiaoxin Sheng