cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Outlook to Excel Flow - Output date format is reversed from dd/MM/yyyy to MM/dd/yyyy only for some items!!

Hi All,

 

I am writing a Flow for Outlook to Excel - When I flag an email in Outlook it is added as a new row in a Excel sheet. I am capturing Date and Subject in that row.

 

I am using below expression string,

 

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

 

For some strange reason - When I flag about 20 emails, about 10 emails date s are captured in wroong format, i.e  MM/dd/yyyy (reversed). I peeked in to the code, where Output shows in the correct format i.e dd/MM/yyyy

 

I could not figure out where is the issue. Kindly advise.

 

1 REPLY 1
Highlighted
Resolver I
Resolver I

Re: Outlook to Excel Flow - Output date format is reversed from dd/MM/yyyy to MM/dd/yyyy only for some items!!

When I read a date field from excel it comes in as a number which is the number of days since 12-30-1899 (30th December 1899).

 

I am fairly sure that if it is a datetime it comes in as a decimal value (sorry have not needed to decode a datetime).

 

Anyway, to turn it into a date I use the following

 

formatDateTime(adddays('12-30-1899',int(variables('Cstart')),'yyyy-MM-dd'),'dd-MM-yyyy')
 
I am just wondering if you reversed this to get your dates as a number and store that into excel - then it would solve the 'inconsistancy issue'?
 
 
Stan

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (7,296)