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

Community site session details

Session Id : inoY8gnj9PgeXG9UXgwIwd
Power Apps - Building Power Apps
Answered

DateValue function malfunctioning in powerapps

Like (0) ShareShare
ReportReport
Posted on 17 May 2020 08:48:14 by

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

I have the same question (0)
  • WarrenBelz Profile Picture
    151,827 Most Valuable Professional on 17 May 2020 at 08:58:44
    Re: DateValue function malfunctioning in powerapps

    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
    on 17 May 2020 at 09:02:09
    Re: DateValue function malfunctioning in powerapps

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

  • WarrenBelz Profile Picture
    151,827 Most Valuable Professional on 17 May 2020 at 09:06:18
    Re: DateValue function malfunctioning in powerapps

    @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
    on 17 May 2020 at 11:12:45
    Re: DateValue function malfunctioning in powerapps

    @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
    151,827 Most Valuable Professional on 17 May 2020 at 11:23:16
    Re: DateValue function malfunctioning in powerapps

    @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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 714 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 419 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard
Loading complete