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!!!

@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

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (4,530)