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 / How to Auto change tex...
Power Apps
Answered

How to Auto change text format into date format

(0) ShareShare
ReportReport
Posted on by 943

Hello, 

Is there any way to make our input text auto change format into date format?

For example:
Input text: 190301   ----->>   Auto change into date format: 01/03/2019


Regards.

Categories:
I have the same question (0)
  • cds Profile Picture
    1,001 on at

    Yes, but you would have to be consistent in how you write it. you cant just do a random string like 190215 and expect it to know that means d/m/y... 

     

    DateValue(Text(textinput.text, "m/d/yyyy"))

  • PytByt Profile Picture
    943 on at

    Hi @cds 

    Thank for your reply.

    Is it works if i use a text box control?

  • cds Profile Picture
    1,001 on at

    you will have to set it as a global or contextual variable.. 
    OnChange = Set(ThisDate, DateValue(Text(TextInput.Text, "mm/dd/yyyy"))) 

  • PytByt Profile Picture
    943 on at

    Hi @cds 

    I try your formula both in variable and direct to the text box, but i dont get the result as i hoped:

    date6.png

    you see, the result is 1/1/1903 when i entered the text value as 190301

    what i needed is 01/03/2019 as date format result.

    I'm hoping to get this:
    Text box value: 190301
    Date format result: 01/03/2019 (dd/mm/yyyy) or 03/01/2019 (mm/dd/yyyy)

    Is this achieveable with powerapps?

  • cds Profile Picture
    1,001 on at

    It is possible but you are going to have to do some serious string manipulation

     

  • PytByt Profile Picture
    943 on at

    can you help?

  • Verified answer
    cds Profile Picture
    1,001 on at

    OK so here is your label: 

    VarDay&"/"&VarMonth&"/"&VarYear

    On your TextInput.OnChange put this:

    UpdateContext({VarYear: "20"& Left(TextInput.Text, 2), VarMonth: Mid(TextInput.Text, 3,2), VarDay: Right(TextInput.Text, 2)})

    This solution wont work for 1900's or 2100's

  • PytByt Profile Picture
    943 on at

    @cds 

    This is wonderful!
    I will try it as soon as i arrived at the HQ.

    Thanks in advance!

    Ps.
    I may have follow up questions for i am a noob in powerapps programming language.

  • cds Profile Picture
    1,001 on at

    For sure! 
    I appreciate the kudos and if it does work, please accept my solution! 😃

  • PytByt Profile Picture
    943 on at

    @cds 

    Where should i put this:
    VarDay&"/"&VarMonth&"/"&VarYear

    ?

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard