---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/tools/datetime_math/variables/dateDiffTool.md
description: Calculate the difference between two dates/times in a chosen unit.
---

# Variable: dateDiffTool

```ts
const dateDiffTool: Tool<SpooledArtifact>;
```

Defined in: [batteries/tools/datetime\_math/index.ts:113](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/tools/datetime_math/index.ts#L113)

Calculate the difference between two dates/times in a chosen unit.

## Remarks

Result is signed — positive when `to` is after `from`, negative otherwise — but rendered as
`|value| <unit> after/before` for readability. Uses luxon's `diff().as(unit)` which respects
calendar arithmetic for months/years.
