cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
k16744
Regular Visitor

Converting Date into Days Number format

Want to convert date to its Days Number format as is shown in Excel popup for formatting cell. I want to enumerate days between Arrival Date & Departure Date for further calculations. Screen Shot attached to clarify my query.

2 ACCEPTED SOLUTIONS

Accepted Solutions

Dear Sir Hardit Bhatia,

Thanks for help.

KUDOS!!!

View solution in original post

@k16744

Glad I could help! Good luck with the rest of your app! Feel free to reach out in case of any questions!

Please accept the reply that helped you as the solution so others can find the solution easily. Also, please consider giving kudos (thumbs up) for any and every reply that helped you!

Thanks,
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

6 REPLIES 6
PowerAddict
Super User
Super User

If your eventual goal is to calculate difference in days between two dates, I suggest you use the DateDiff function.

Here is more info about it: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff#des...

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com
eka24
Super User
Super User

Datevalue(Datefield.SelectedDate)

@k16744 

The idea proposed by @PowerAddict is correct.  If you want to show exactly the same number as in your picture use this code.

 

DateDiff(Date(1900,1,0),Today(),Days)+1

 

The output will be a number

 

43876

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

And just to add to that, if the eventual goal is to calculate the difference between Arrival Date and Departure Date, you can simply use DataDiff to do that:

DataDiff(ArrivalDate, DepartureDate) will give you DepartureDate-ArrivalDate

DateDiff(DepartureDate, ArrivalDate) will give you ArrivalDate-DepartureDate

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com

Dear Sir Hardit Bhatia,

Thanks for help.

KUDOS!!!

View solution in original post

@k16744

Glad I could help! Good luck with the rest of your app! Feel free to reach out in case of any questions!

Please accept the reply that helped you as the solution so others can find the solution easily. Also, please consider giving kudos (thumbs up) for any and every reply that helped you!

Thanks,
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,261)