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 Apps
Suggested Answer

Date in UK format

(2) ShareShare
ReportReport
Posted on by 303
I have a flow with a UK date string dd/mm/yyyy e.g. '29/01/2025'

I need to convert this to the format yyyy-MM-dd e.g. 2025-01-29


If I use 
=Text(DateValue("29/01/2024"), "yyyy-mm-dd")  
I get an error ' date cannot be parsed'. I think this is because it is expecting mm/dd/yyyy. 

So how can I convert the string '29/01/2025' to 2025-01-29 using powerfx?
 
Categories:
I have the same question (0)
  • Suggested answer
    Daniel Bocklandt Profile Picture
    5,117 Super User 2025 Season 2 on at
     
    Yes there seems to be a bug in the DateValue function. It gives another date. 
    Here's a way to do it without this function. 
    With(
        {
            Datesplit: Split(
                "29/01/2025",
                "/"
            )
        },
        Text(
            Date(
                Last(Datesplit).Value,
                First(
                    LastN(
                        Datesplit,
                        2
                    )
                ).Value,
                First(Datesplit).Value
            ),
            "yyyy-mm-dd"
        )
    )
    Let me know if it helped you. 
     

    If this solved your problem, please mark it as Solved to help others find the solution faster.
    If you found it helpful, consider giving it a Like to support each other in this community!

    Thanks, and happy building!

  • timl Profile Picture
    36,415 Super User 2025 Season 2 on at
     
    Since your input is in UK format, the safest way to do this is to specify the "en-GB" locale like so.
     
    That should hopefully resolve this issue.
     
    Text(DateValue("29/01/2024","en-GB"), "yyyy-mm-dd")
      
     
     
     
     
  • Nirav Raval (Akira28) Profile Picture
    153 Moderator on at
    Hi nick9one1 ,


    Try below formula and check
    Text(DateValue(Mid("29/01/2025", 4, 2) & "/" & Left("29/01/2025", 2) & "/" & Right("29/01/2025", 4)), "yyyy-MM-dd")
    
     
     


    If this post solved your issue, clicking 'Does this answer your question' will help others discover the solution and close the topic. If you found it helpful, a Like would be awesome!
     
     
    Regards,
    Nirav J Raval (Akira28) 🤞
  • timl Profile Picture
    36,415 Super User 2025 Season 2 on at
     
    The formula that you posted converts the input value to mm/dd/yyyy and passes it to DateValue.
     
    This won't work in the UK because the expected format is dd/mm/yyyy. 

    As the screenshot below highlights, parsing this incorrect format in a UK setup produces the incorrect result of '2027-05-01'.
     
     
     
     
    For users in the UK, the best approach is to include the "en-GB" specifier which will ensure that the date is properly parsed in UK format, as shown below.
     
     
     
     

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard