How to get the middle date between the two different dates

Hi,

Thanks in Advance!!

I want to get the middle date between the two different dates. I have the value of StartDate & Enddate. I want an output of the middle date between the StartDate and EndDate.
Please see the screen shot for your reference.

Date

Thanks & Regards,
Anbumani S

HI @anbumani.sakthivel

Have look on the thread

Regards
Gokul

Hi @Gokul001,

It will the number of days only.
But I need the Middle Date of the StartDate & EndDate. If I have an value StartDate=“01/10/2022” & EndDate=“01/20/2022”.
Expect Output was MiddleDate=“01/15/2022”.

Thanks & Regards,
Anbumani S

Hi,

DateTime dtMiddle = dtStart.AddDays ((dtEnd.Day - dtStart.Day)/2)
It will get the Middle Date between the two dates.

Thanks & Regards,
Anbumani S

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.