web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Day and month swap whe...
Power Automate
Unanswered

Day and month swap when sent to Excel

(0) ShareShare
ReportReport
Posted on by 13

Hi,

I have a simple flow that looks for new file in Sharepoint and record the file name with the date of creation in an excel file.

All works except the date of creation which return the day and month swapped.

In Power Automate, I can see in the log the Date being displayed like 2024-04-08T06:06:58Z. So April the 8th.

In the "Add line to Excel" block, I did set a file DATE like : formatDateTime(triggerBody()?['Created'],'dd/MM/yyyy')

In the log I see DATE as "08/04/2024", 8th of april (which is my defaut location setting as I am in Europe).
But when I open the excel file, the 8th of April becomes the 4th of August !

Is there a setting somewhere or what do I do wrong in the blocks ?

I search though but could not make it to work.

 

Thanks

Categories:
I have the same question (0)
  • mdesloges Profile Picture
    13 on at

    @v-yetonggu-msft 

    it does become August 8. When I filter all the april days, I do not see the 8th of april. But I see august 8th. So excel definetly see it and recognize it as August not april. See below the example snapshots.

     

    Thanks for support

    d6f36232-4ebf-4dde-83ed-8b716f437eca.pngBlock : Add line in ExcelBlock : Add line in Excel

    Line in Exce fileLine in Exce file

    Filter of the Excel columnFilter of the Excel column

  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    You switched month and date yourself 😉

    Use formatDateTime(triggerBody()?['Created'],'yyyy-MM-dd')

    or just

    triggerBody()?['Created'] and set the display format in Excel accordingly.

  • v-yetonggu-msft Profile Picture
    on at

    Hi @mdesloges ï¼Œ

    My last reply was wrong, I will be more rigorous in my future replies.

    The standard date format of US is not 'dd/MM/yyyy', but 'MM/dd/yyyy'.

    So you should not use the expression formatDateTime(triggerBody()?[' Created'],'dd/MM/yyyy'), please use formatDateTime(triggerBody()?[' Created'],'MM/dd/yyyy').

     

    formatDateTime(triggerBody()?[' Created'],'MM/dd/yyyy')

     

    Or you can use the 'yyyy-MM-dd' format @Chriddle  said.

    Best Regards,

    Sunshine Gu

  • Verified answer
    mdesloges Profile Picture
    13 on at

    Hi @v-yetonggu-msft , @Chriddle , I made this change in the Add line to Excel block : formatDateTime(triggerBody()?['Created'],'yyyy-MM-dd')

    And the result is :

    Created Date of file in the Sharepoint Block :2024-04-09T07:35:01Z - ALL GOOD

    Date in the Add line to Excel block :2024-04-09 - ALL GOOD

    Date in Excel file : 09/04/2024 : 9th of April 2024 !!! ALL GOOD

    Thanks to both for the tip!

    Solved 

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard