# Compare two date

**URL:** <https://forum.uipath.com/t/compare-two-date/100745>\
**Category:** Help\
**Tags:** system, activities\
**Created:** [March 8, 2019, 10:53am UTC](https://forum.uipath.com/t/compare-two-date/100745 "2019-03-08T10:53:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rup\_1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rup_1/32/177294_2.png) [@Rup\_1](https://forum.uipath.com/u/Rup_1)\
**Post date:** [March 8, 2019, 10:53am UTC](https://forum.uipath.com/t/compare-two-date/100745/1 "2019-03-08T10:53:10Z")

</div>

Hi Friends,  
How to compare two date and how to calculate difference between two dates in number of days.  
the date is like:-  
09/10/18 and 10/03/18  
Regards,

---

<div class="post-metadata">

**Author:** ![sreekanth](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sreekanth/32/18594_2.png) [@sreekanth](https://forum.uipath.com/u/sreekanth)\
**Post date:** [March 8, 2019, 11:14am UTC](https://forum.uipath.com/t/compare-two-date/100745/2 "2019-03-08T11:14:15Z")

</div>

Refer this @Rup_1

> [@How to Compare two date](https://forum.uipath.com/t/how-to-compare-two-date/85012/4):
>
> You can use Convert.ToDateTime(your-string-date-variable) and assign it to a variable (let say monthVar). After that you can get the month by using monthVar.Month and compare it with second-date.Month Alternatively you could go the convoluted way and create an array of months and compare the index+1 of the array with your integer month.

---

<div class="post-metadata">

**Author:** ![Rup\_1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rup_1/32/177294_2.png) [@Rup\_1](https://forum.uipath.com/u/Rup_1)\
**Post date:** [March 8, 2019, 11:44am UTC](https://forum.uipath.com/t/compare-two-date/100745/3 "2019-03-08T11:44:25Z")

</div>

thanks for responce Could you please provide xaml file if possible

---

<div class="post-metadata">

**Author:** ![anil5](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil5/32/48965_2.png) [@anil5](https://forum.uipath.com/u/anil5)\
**Post date:** [March 8, 2019, 11:49am UTC](https://forum.uipath.com/t/compare-two-date/100745/4 "2019-03-08T11:49:09Z")

</div>

DateDiff(DateInterval.Day, Convert.todatetime(“05-12-2019”),Convert.todatetime(“07-12-2019”))

Refer the below workflow

[get recent file.xaml](https://global.discourse-cdn.com/uipath/original/3X/7/6/76b706174dc24dc9530199d4b215060aae4246a9.xaml) (8.0 KB)

Hope It helps!

In your scenario use

DateDiff(DateInterval.Day,Convert.ToDateTime(“09/10/18”),convert.ToDateTime(“10/03/18”))
