# Modified Java Script

**URL:** <https://community.automationedge.com/t/modified-java-script/2956>\
**Category:** Get Help & Discuss\
**Tags:** rpa\
**Created:** [April 2, 2021, 6:56am UTC](https://community.automationedge.com/t/modified-java-script/2956 "2021-04-02T06:56:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanmay](https://avatars.discourse-cdn.com/v4/letter/t/ccd318/32.png) [@Tanmay](https://community.automationedge.com/u/Tanmay)\
**Post date:** [April 2, 2021, 6:56am UTC](https://community.automationedge.com/t/modified-java-script/2956/1 "2021-04-02T06:56:52Z")

</div>

Do we Have any function in Modified Java Script which can calculate the past no. of days by comparing current date.

for eg. we have AddDiff function which adds number of days/month/years.

In same way can we substract no. of days minus current date.  
for eg. - i have to calculate no. of employees joined the company in last 180 days from the current date.

---

<div class="post-metadata">

**Author:** ![Imran\_Bhole](https://avatars.discourse-cdn.com/v4/letter/i/b9e5f3/32.png) [@Imran\_Bhole](https://community.automationedge.com/u/Imran_Bhole)\
**Post date:** [April 3, 2021, 4:57am UTC](https://community.automationedge.com/t/modified-java-script/2956/2 "2021-04-03T04:57:36Z")

</div>

Hi Tanmay,

Please see below function.

var date=new Date(), var prevDatte= addDate(date,‘d’, -180)

---

<div class="post-metadata">

**Author:** ![Tanmay](https://avatars.discourse-cdn.com/v4/letter/t/ccd318/32.png) [@Tanmay](https://community.automationedge.com/u/Tanmay)\
**Post date:** [April 3, 2021, 7:24am UTC](https://community.automationedge.com/t/modified-java-script/2956/3 "2021-04-03T07:24:10Z")

</div>

Hi Imran,

Thank You for helping will give a try to this.
