Announcements
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
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
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.
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.
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.
in the database, the date format is as follows: 03.09.2022 00:00:00
i.e. the format does not matter when comparing? and should it work properly?
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.
In the Date Picker, you simply need to change the Format property as I posted.
If you want to display if as Text
Text(DateValue1.SelectedDate,"dd.mm.yyyy")
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 243 Super User 2026 Season 2
WarrenBelz 204 Most Valuable Professional
Mohsin Ali 122