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 / Trying to get accurate...
Power Apps
Answered

Trying to get accurate DateDiff between Australian formatted date (dd/mm/yyyy) and PowerApps Now() function

(0) ShareShare
ReportReport
Posted on by 273

Having some trouble getting the right DateDiff value between PowerApps Now() and an AUS formatted date time in dd/mm/yyyy. 

 

Current date time = 20/05/2019. 

The date in my data field = 30/06/2019

 

Function Now() = 5/20/2019 11:19 AM

(Trying to convert to AUS format) DateValue(Text(Now(),"[$-en-US]dd/mm/yyyy")) = 8/5/2020

(Trying to format the AUS data field to a DateValue) DateValue(LabelExpiry.Text) = 6/6/2021

 

Formula = DateDiff(DateValue(LabelExpiry.Text),DateValue(Text(Now(),"[$-en-US]dd/mm/yyyy")),Months)

 

This produces - 10 or 10, depending on which value you put first. This is not expected at all. What I would expect is - in months at least - either a 1 or 0 depending on how it calculates. 

Categories:
  • Verified answer
    v-yuxima-msft Profile Picture
    Microsoft Employee on at

    Hi @JamesM 

     

    Could you please reference this case:

    https://powerusers.microsoft.com/t5/General-Discussion/Date-Format/td-p/615

    And you can also use one datepicker control,and the format property can be set what format you want.

    datepicker.PNG

    DateDiff(Now(),DatePicker1.SelectedDate,Months) 

    it will show 0   (for my test)

    DateDiff(Now(),DatePicker1.SelectedDate,Days)

    it will show -2   (for my test)

     

    Note:

    By default, the language used is that of the current user, but you can override this to ensure that strings are interpreted properly. For example, "10/1/1920" is interpreted as October 1st in "en" and as January 10th in "fr".

     

    More information:

    function-datevalue-timevalue

     

    Hope this could be helpful.

     

    Best Regards.

    Yumia

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 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard