cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
JamesM
Level 8

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

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

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

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

1 REPLY 1
Community Support Team
Community Support Team

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

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