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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,056)