# Transform to get difference between two dates in numeric form

**URL:** <https://developer.sailpoint.com/discuss/t/transform-to-get-difference-between-two-dates-in-numeric-form/141478>\
**Category:** SHF Discussion and Questions\
**Tags:** identity-security-cloud, transforms\
**Created:** [June 5, 2025, 12:34pm UTC](https://developer.sailpoint.com/discuss/t/transform-to-get-difference-between-two-dates-in-numeric-form/141478 "2025-06-05T12:34:08Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![sup3rmark](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/sup3rmark/32/36229_2.png) [@sup3rmark](https://developer.sailpoint.com/discuss/u/sup3rmark)\
**Post date:** [June 5, 2025, 2:59pm UTC](https://developer.sailpoint.com/discuss/t/transform-to-get-difference-between-two-dates-in-numeric-form/141478/6 "2025-06-05T14:59:54Z")

</div>

Okay, see this post here for my thoughts on this in general (TL;DR - you likely want to look at more than just that one attribute) - [Transform - Find Users' Last Activity Date (find latest date in array)](https://developer.sailpoint.com/discuss/t/transform-find-users-last-activity-date-find-latest-date-in-array/34841).

For your use case, you’ll want to find the latest date of all the relevant attributes, then do a dateCompare with `now-30d` as the `secondDate`. If the `firstDate` is less than `second date`, then return `>30 days`, otherwise return `<30 days`.

---

_[View the full topic](https://developer.sailpoint.com/discuss/t/transform-to-get-difference-between-two-dates-in-numeric-form/141478)._
