cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 147 members 3,710 guests
Please welcome our newest community members: