---
title: "Date Difference"
description: "Local-first visual environment for building and running AI workflows. Build agents visually, deploy anywhere, privacy by design."
canonical: https://docs.nodetool.ai/nodes/lib/datetime/datedifference
markdown: https://docs.nodetool.ai/nodes/lib/datetime/datedifference.md
product: NodeTool
source: https://github.com/nodetool-ai/nodetool/blob/main/docs/nodes/lib/datetime/datedifference.md
---

# Date Difference

**Type:** `lib.datetime.Diff`

**Namespace:** `lib.datetime`

## Description

Difference between two dates (date_a − date_b) expressed in the given unit.
    date, diff, difference, between, duration

## Properties

| Property | Type | Description | Default |
|----------|------|-------------|---------|
| date_a | `any` |  | `` |
| date_b | `any` |  | `` |
| unit | `enum` | Unit for the returned diff. | `day` |

## Outputs

| Output | Type | Description |
|--------|------|-------------|
| diff | `int` |  |
| is_before | `bool` |  |
| is_after | `bool` |  |
| is_same | `bool` |  |

## Related Nodes

Browse other nodes in the [lib.datetime](./) namespace.
