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 / 'formatDateTime', the ...
Power Automate
Answered

'formatDateTime', the value provided for date time string '45657.9999884259' was not valid.

(1) ShareShare
ReportReport
Posted on by 13
Hello,
 
i have a problem with my date columns. I formatted my excel by python in this format: ".dt.strftime('%Y-%m-%d 00:00:00')"
 
Now for 2 of 4 columns it works to format this datetime in my powerautomate flow with this function, before i write it inrto my list: "formatDateTime(variables('Zuletzt geändert am_2'), 'MM/dd/yyyy')"
 
But for the other two ones i still get this error, not matter whatever i tried:
 
"'In function 'formatDateTime', the value provided for date time string '45657.9999884259' was not valid. The datetime string must match ISO 8601 format.'"
 
 
I don't know why but in normal excel opening and also if i convert the file into csv and take a look at notepad, the date look still like this everywhere: "2024-03-08 00:00:00"
 
But i seems like the excel connector of powerautomate convert this 2 columns everytime into numbers before it works with it...
 
Hope someone could help me with this, looking for almost 1 week for a solution and don't have ideas anymore...
Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at
    You can use the addDays with 30-12-1899 as a start date if you are only interested in the date portion?
     
    Try something like below
    addDays('1899-12-30', int(formatNumber(45657.9999884259, '0')), 'MM-dd-yyyy')
     
  • ZickQian Profile Picture
    2 on at
    1. make sure  formatting in Excel for the columns is Date format, you can right click the cells->format cells , then check formatting 
    2. How did you set the variables('Zuletzt geändert am_2') ? Could you send screen copy ? 
  • siwfy Profile Picture
    Microsoft Employee on at
    Hi there. You mentioned Excel in the post, I am assuming you are using "List rows present in a table" from Excel Online (Business) connector, right? If yes, the probable underlying cause to this is that Excel stores date values in serial numbers, which are numerical values. However, Power Automate processes date values in ISO8601 format, which are string values. When Power Automate fetches the dates from Excel, they are treated as serial numbers by default. You can switch the dates to ISO8601 format by selecting it in "DateTime Format" option in "List rows present in a table" action. Now you can use formatDateTime() to format the datetime.

  • Verified answer
    HG-24070956-0 Profile Picture
    13 on at
    @swify, yes i already used the datetime format option and choose the ISO 8601 Option
     
     
    doesn't work if i format the column in excel into a data format.
     
    But I solved it another way. I no longer tried to insert the content of my auxiliary variable. I use this to see if there is an empty value in this column of the entry. After this is false, I take the value directly from Excel and do not take the detour via the assigned value of the variable. For some reason this works, although it is the same value that was assigned to the variable.
     
     
     

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard