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

Re: Converting Date into Days Number format

Dear Sir Hardit Bhatia,

Thanks for help.

KUDOS!!!

View solution in original post

Highlighted
Super User
Super User

Re: Converting Date into Days Number format

@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
Highlighted
Super User
Super User

Re: Converting Date into Days Number format

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
Highlighted
Community Champion
Community Champion

Re: Converting Date into Days Number format

Datevalue(Datefield.SelectedDate)
Highlighted
Super User
Super User

Re: Converting Date into Days Number format

@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."

Highlighted
Super User
Super User

Re: Converting Date into Days Number format

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
Highlighted
Regular Visitor

Re: Converting Date into Days Number format

Dear Sir Hardit Bhatia,

Thanks for help.

KUDOS!!!

View solution in original post

Highlighted
Super User
Super User

Re: Converting Date into Days Number format

@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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,319)