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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / DateValue function mal...
Power Apps
Answered

DateValue function malfunctioning in powerapps

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi PowerUsers, I am trying to convert a text string into date  in powerapps by using DateValue function but it gives me a random date which is not the actual string which is passed to this function. 

I have a string like "30/04/2020" and I am trying to format it as "2020/04/30"
Passing this text directly in Text( ) function doesn't work, I have tried Text("30/04/2020", "[$-en-US]yyyy/mm/dd")

I know I have to pass it in DateValue function first to make this conversion but when I pass it to DateValue ( ) function the result is altogether wrong, I am trying this  Text(DateValue("30/04/2020"),"[$-en-US]yyyy/mm/dd"). It returns me this date "2022/06/04".

I am stuck on this thing, any workaround is appreciated. 
Looking forward to an early and helpful response. 

Regards,
Ali Nawaz

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,755 Most Valuable Professional on at

    Hi @Anonymous ,

    You were close

    Text(DateValue("4/30/2020"),"[$-en-US]yyyy/mm/dd")

    We all use US dates apparently . . . just watch out for it possibly turning into your local format after about 30 seconds and then being invalid - just turn it back into US and it will be fixed - mine goes to Text(DateValue("4/30/2020"),"[$-en-AU]yyyy/mm/dd")

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @WarrenBelz I am making this application for a client who is in German timezone. 
    US format is not needed here. 

  • WarrenBelz Profile Picture
    154,755 Most Valuable Professional on at

    @Anonymous ,

    I just added to my post - you need to use US for this format. This is nothing to do with Time Zone - it is about supported (by Power Apps) formats. I am in Australia and have to change mine all the time for anything other than our dd/mm/yyyy format.

    DateValueText.png

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @WarrenBelz Thanks I have tried your solution but somehow it does not work for me. 
    Although I have found the workaround myself. 
    I have put the "fr" string in the DateValue () function and it is working as intended now. 

    Text(DateValue("30/05/2020","fr"),"[$-en-US]yyyy/mm/dd")


    Regards,
    Ali Nawaz

  • WarrenBelz Profile Picture
    154,755 Most Valuable Professional on at

    @Anonymous ,

    Obviously I could not test that from Australia. The issue was lining up the format and the region - I have to use US here as it will not accept AU and in doing so have to use US mm/dd/yyyy format. It is strange that it accepts fr and not de as you mentioned German requirements.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 493 Most Valuable Professional

#2
11manish Profile Picture

11manish 479

#3
Haque Profile Picture

Haque 328

Last 30 days Overall leaderboard