Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Suggested answer

Format a Date dd.mm.yyyy into yyyy-mm-dd in power Apps

Like (1) ShareShare
ReportReport
Posted on 4 Oct 2024 11:06:12 by 8
Hello Everybody
 
I am trying to format a date from dd.mm.yyyy into yyyy-mm-dd.
 
I found the following formula on the internet, but it does not work. 
 
DateValue(DataCardValue.SelectedDate; "yyyy/mm/dd")

Can anyone help me?
 
Thank you in advance
  • CarlosFigueira Profile Picture
    CarlosFigueira on 04 Oct 2024 at 14:01:29
    Format a Date dd.mm.yyyy into yyyy-mm-dd in power Apps
    If the DataCardValue is a date picker control (that already gives you the a date value), then you can use the Text function to format it as you want:
    Text(
      DataCardValue.SelectedDate,
      "yyyy-mm-dd"
    )
    If the date you have is a text value, then you can use the DateValue function to convert that into a date value. The second argument of DateValue is a locale, and the date will be parsed in that locale. In "dd.mm.yyyy" is the default format for the de-DE locale, so you can use an expression like the following:
    Text(
      DateValue(<your date as text>, "de-DE"),
      "yyyy-mm-dd"
    )
    Hope this helps!
  • Suggested answer
    abc 123 Profile Picture
    abc 123 708 on 04 Oct 2024 at 14:00:36
    Format a Date dd.mm.yyyy into yyyy-mm-dd in power Apps
    //Use intrinsic date formats based on region
    UpdateContext({strWrongFormat: "04.10.2024"});
    UpdateContext({dtmRightFormatEn: DateValue(strWrongFormat,"en") });
     
    //Take full control
    UpdateContext({strDay: Left(strWrongFormat,2)});
    UpdateContext({strMonth: Mid(strWrongFormat,4,2)});
    UpdateContext({strYear: Right(strWrongFormat,4)});
     
    UpdateContext({dtmRightFormatCustom: DateValue(strMonth & "/" & strDay & "/" & strYear) });


     
     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,411

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,328

Leaderboard