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 / Issue with date format...
Power Automate
Answered

Issue with date format when using UTC function

(0) ShareShare
ReportReport
Posted on by 6

Hi all,

 

Just wondeting what I am missing here, I've tried different combination but still keep getting the same error.

 

concat('Supplier Sales Report ', formatDateTime(addDays(convertFromUtc(triggerOutputs()?['body/receivedDateTime'],'AUS Eastern Standard Time'),-1),'yyyyMMdd'),'.xlsx')

 

InvalidTemplate. Unable to process template language expressions in action 'Create_file' inputs at line '1' and column '24868': 'The template language function 'convertFromUtc' expects its first parameter to be a string that contains a UTC date time. The value was '2021-08-29T02:43:53.0000000+00:00'. Please see https://aka.ms/logicexpressions#ConvertFromUtc for usage details.'.

Categories:
I have the same question (0)
  • Verified answer
    eric-cheng Profile Picture
    5,171 on at

    Hi @guinaba ,

     

    Try the below inside your concat()

     

    formatDateTime(addDays(convertFromUtc(formatDateTime(triggerOutputs()?['body/receivedDateTime'], 'yyyy-MM-ddTHH:mm:ss.fffffffZ'),'AUS Eastern Standard Time'),-1),'yyyyMMdd')

     

    I tried with the provided datetime

     

    formatDateTime(addDays(convertFromUtc(formatDateTime('2021-08-29T02:43:53.0000000+00:00', 'yyyy-MM-ddTHH:mm:ss.fffffffZ'),'AUS Eastern Standard Time'),-1),'yyyyMMdd')

     

    and got

     

    ericcheng_0-1630239170308.png

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

     

     

     

     

  • Ellis Karim Profile Picture
    11,684 Super User 2025 Season 2 on at

    Check the <timestamp> required by the addDays function. For example, I am sending date with a format of yyyy-MM-ddThh:mm:ssZ (yyyy-MM-dd would also work):

    ekarim2020_0-1630239549673.png

    addDays(body('Convert_time_zone'),-1)
    formatDateTime(outputs('Compose'),'yyyMMddd')

    ekarim2020_0-1630240064812.png

     

    Ellis

  • guinaba Profile Picture
    6 on at

    Awesome! Thanks @eric-cheng ! It is working now!

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

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard