Need to update the timezone information in the body of the exported email

Ashish Gupta 1 Reputation point
2020-07-31T20:26:24.687+00:00

Hi,

I've created a Logic App which reads the incoming email. As we know that the default timezone in Logic Apps is UTC. In my logic app, I'm exporting the email and saving the email as .eml file in a SharePoint Library. In the .eml file, the "Sent on" field shows the date time in UTC. I want to show the original date time there. I've already tried the Convert Time Zone action, but that didn't help. Can someone help me how to update the timezone information in the body of the exported email?

Thanks,
Ashish

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,951 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JayaC-MSFT 5,526 Reputation points
    2020-08-04T08:17:27.693+00:00

    @Ashish Gupta If the emails are sent from a particular timezone then we can use Convert Time zone by hardcoding the time zones. I have verified the same for the received date time for outlook email connector :
    @{convertTimeZone(triggerBody()?['receivedDateTime'],'UTC', 'Pacific Standard Time')} and it works.
    You may also refer to the supported date and time functions : https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#date-and-time-functions

    Please let me know if this helps.

    ---------------------------------------------

    Updates :

    @Ashish Gupta Thank you for sharing the details. From the screen shot I understand that you are referring to the share point file view. Upon investigation and after re-verifying I see that even after substituting the dates ( using azure function) before creating the file, still the share point file shows the UTC time. This is not an issue with the connector, this is how share point renders the view. However, you can also test it. You can download the file and open it ( for me outlook app), you can see the original date when it was sent. Now if you edit the file in text mode( in Notepad etc.) , you may change the date of the field "Date". After updating manually and saving this, try to open the file locally, you can see the updated time in your time zone. Now if you upload the same file to share point and open the file there, you will see the "Sent On" date in UTC. Hence, it is clear that how the view is rendered in share point.

    Please 'Accept as answer' if it helped so that it can help others in the community looking for help on similar topics.