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 / Issue with converting ...
Power Apps
Answered

Issue with converting Text Date in dd/mm/yyyy format to yyyy-mm-dd

(0) ShareShare
ReportReport
Posted on by 67

Hi PA Community members,

 

I'm facing an issue with a text to date conversion. I believe it is possibly very common problem, but I have not found a correct solution from any previous posts yet!

 

In my app, I have customer requests coming in with a date as text, in dd/mm/yyyy format.

I am storing the data in a Collection with the following code:

 

due_date: Text(DateValue(TextInput_RepDt1.Text), "yyyy-mm-dd")

 

 

It is working correctly, unless the day value is more than 12. it then changes the entire date. The screenshot below will help to explain the situation:

datetime.png

The left image is how the data is displayed, and the right image is how the collection stores the date.

This is causing huge problem as I'm storing the above date in a SQL DB table (with a Patch function).

 

Can anyone please point out what changes I need to make in my formula to convert a date correctly?

 

Thanks

Ozzie

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,968 Moderator on at

    Hi @ozzie14 ,

     

    Its ironic I have had this exact same situation that I answered for 2 times in 2 weeks.

     

    Its because the Month is NOT the month its the Day and Day is not the Day its the Month. Hence why over 12 doesn't work etc.

     

    You have the format backwards for dd and MM

    trust me.


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • Verified answer
    Mike2500 Profile Picture
    1,247 Super User 2024 Season 1 on at

    It looks like the inbound date is in a european format, day/month/year, while the system is expecting a US format of month/day/year. (my apologies, I don't know much about international date formats, there's probably better names for this besides european vs US).

     

    the DateValue function has a second argument where you can specify the "language code". If I use your same example, but use a german language code, it works fine:

     

    Text(datevalue(txtDate.Text, "de"),"yyyy-mm-dd")

     

    (of course, pick an appropriate language code, not just the random one I chose)

  • ozzie14 Profile Picture
    67 on at

    Hi @Mike2500 ,

     

    The "de" (I've used "uk") resolved the date conversion problem.

     

    Thanks a tonne..

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard