A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
Hi @MUHAMMET GUNES , Welcome to Microsoft Q&A.
Maybe it's an effect of the timing part.
If the time portion of the is set to a time earlier than the time portion of the , this may result in a duration of 29 days instead of 30 days.
Try using:
duration = endDate.Date - startDate.Date;
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.