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 change format date
Power Apps
Answered

How to change format date

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi, I want to compare the date, but the date in the database has format dd.mm.yyyy, and the date in my datevalue1 has dd/mm/yyyy.

Is there any function that would change the date format to dd.mm.yyyy?

My code:

DATEDB >= DataValue1.SelectedDate

 

Categories:
  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @Anonymous ,

    If you simply want to display it in this format in the Date Picker, change the Format property of the Date Picker to 

    "dd.mm.yyyy"

     

    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.

    Visit my blog Practical Power Apps

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

    Are you certain the field in the database is actually a date data type, and not a string (text)? If the data type is correct and they are both dates, the comparisons should work fine, regardless of how the dates are formatted. If it's a text, then something like 12.30.2021 isn't actually a date, and is instead a the characters 12, followed by a dot, followed by 30, followed by a dot, etc. Trying to do conditions based on greater or less than won't work with this sort of text value. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I changed the date format, but still in datevalue1.selecteddate I get the date in the format dd/mm/yyyy. 

    i tried to change the date format with substitute()

    DATEDB >= Substitute(DateTimeValue(DateValue1.SelectedDate,"pl-PL"),"/",".")

    but it returns me an error that: Invalid argument type. Expecting number, date etc.

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

    Again, the format should be irrelevant if the data type is correct. If you do format it, then you have a string and no longer have a date, and again, using less than or greater than comparisons won't work. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    in the database, the date format is as follows: 03.09.2022 00:00:00

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    i.e. the format does not matter when comparing? and should it work properly?

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

    Correct, formats are how the values are displayed, but what matters are the actual underlying values. For example, some systems store dates as the number of milliseconds since 1970, but that's not a readable format for people, so the systems don't actually display that value, and instead display a formatted value. But when doing comparisons, the system actually uses the milliseconds value. (And no, in this example, we don't need to pass it the milliseconds for it to work, we need to pass it a date).

     

    Summary: when working with dates, we need dates, not pretty strings.

  • WarrenBelz Profile Picture
    156,956 Most Valuable Professional on at

    Hi @Anonymous ,

    In the Date Picker, you simply need to change the Format property as I posted.

    WarrenBelz_0-1640864240697.png

    If you want to display if as Text

     

    Text(DateValue1.SelectedDate,"dd.mm.yyyy")

     

     

     

    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.

    Visit my blog Practical Power Apps

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard