# Workflows: Subtract time in define variable

**URL:** <https://developer.sailpoint.com/discuss/t/workflows-subtract-time-in-define-variable/18331>\
**Category:** SHF Discussion and Questions\
**Tags:** workflows, sailpoint-identity-security\
**Created:** [August 21, 2023, 3:48pm UTC](https://developer.sailpoint.com/discuss/t/workflows-subtract-time-in-define-variable/18331 "2023-08-21T15:48:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![MBowen](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/mbowen/32/1500_2.png) [@MBowen](https://developer.sailpoint.com/discuss/u/MBowen)\
**Post date:** [August 21, 2023, 3:48pm UTC](https://developer.sailpoint.com/discuss/t/workflows-subtract-time-in-define-variable/18331/1 "2023-08-21T15:48:54Z")

</div>

What if I need to subtract 15 days??? I tried this but get these failures:

subtractTime transform: length exceed max limit. Transformed date cannot be less than current date

I am saying “from today” I want folks who were hired within the past 14 days.

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [August 21, 2023, 6:05pm UTC](https://developer.sailpoint.com/discuss/t/workflows-subtract-time-in-define-variable/18331/2 "2023-08-21T18:05:30Z")

</div>

Subtracting time from `$.now()` is not yet supported. Is that what you are trying to do, or are you subtracting from a different date?

---

<div class="post-metadata">

**Author:** ![MBowen](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/mbowen/32/1500_2.png) [@MBowen](https://developer.sailpoint.com/discuss/u/MBowen)\
**Post date:** [August 21, 2023, 6:10pm UTC](https://developer.sailpoint.com/discuss/t/workflows-subtract-time-in-define-variable/18331/3 "2023-08-21T18:10:02Z")

</div>

Yep… that’s what I am trying to do… I want to go back -14 days…

---

<div class="post-metadata">

**Author:** ![gmilunich](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/gmilunich/32/8431_2.png) [@gmilunich](https://developer.sailpoint.com/discuss/u/gmilunich)\
**Post date:** [September 28, 2023, 1:16pm UTC](https://developer.sailpoint.com/discuss/t/workflows-subtract-time-in-define-variable/18331/4 "2023-09-28T13:16:57Z")

</div>

> [@colin\_mckibben](#):
>
> Subtracting time from `$.now()` is not yet supported. Is that what you are trying to do, or are you subtracting from a different date?

Colin, is there a timeframe as to when this will be added to the Define Variable? I have a similar request coming up. If not, how would you suggest this be handled within the workflow?

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [September 28, 2023, 2:38pm UTC](https://developer.sailpoint.com/discuss/t/workflows-subtract-time-in-define-variable/18331/5 "2023-09-28T14:38:44Z")

</div>

No commitment yet. The ticket for my reference is PLTWRKFLW-2983. I’ll update this post once date subtraction is enabled.

---

<div class="post-metadata">

**Author:** ![drosenbauer](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/drosenbauer/32/3381_2.png) [@drosenbauer](https://developer.sailpoint.com/discuss/u/drosenbauer)\
**Post date:** [September 28, 2023, 4:00pm UTC](https://developer.sailpoint.com/discuss/t/workflows-subtract-time-in-define-variable/18331/6 "2023-09-28T16:00:14Z")

</div>

I submitted this idea earlier, which I think would solve this and a plethora of other problems.

[Allow transforms in workflows](https://ideas.sailpoint.com/ideas/GOV-I-2955)

Transforms already have _dateMath_, including date format conversion, so there wouldn’t even really be a need to add anything new to the IDN codebase.

---

<div class="post-metadata">

**Author:** ![MBowen](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/mbowen/32/1500_2.png) [@MBowen](https://developer.sailpoint.com/discuss/u/MBowen)\
**Post date:** [October 6, 2023, 11:34am UTC](https://developer.sailpoint.com/discuss/t/workflows-subtract-time-in-define-variable/18331/7 "2023-10-06T11:34:36Z")

</div>

Except when you have end users that use the UI more than the code base (like my manager) who wants to do this kind of stuff w/out being too code knowledgeable.

---

<div class="post-metadata">

**Author:** ![drosenbauer](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/drosenbauer/32/3381_2.png) [@drosenbauer](https://developer.sailpoint.com/discuss/u/drosenbauer)\
**Post date:** [October 6, 2023, 3:23pm UTC](https://developer.sailpoint.com/discuss/t/workflows-subtract-time-in-define-variable/18331/8 "2023-10-06T15:23:54Z")

</div>

Ideally, you’d pick a transform name from a dropdown, so your manager would simply pick the pre-existing transform you created called “14 days ago”.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [December 5, 2023, 3:24pm UTC](https://developer.sailpoint.com/discuss/t/workflows-subtract-time-in-define-variable/18331/9 "2023-12-05T15:24:40Z")

</div>

Closed on December 5, 2023, 3:24pm UTC

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

---

<div class="post-metadata">

**Author:** ![colin\_mckibben](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/colin_mckibben/32/37182_2.png) [@colin\_mckibben](https://developer.sailpoint.com/discuss/u/colin_mckibben)\
**Post date:** [September 12, 2024, 7:12pm UTC](https://developer.sailpoint.com/discuss/t/workflows-subtract-time-in-define-variable/18331/10 "2024-09-12T19:12:07Z")

</div>

Subtract time is now supported as a date transform option in the Define Variable operator.
