Nodes/Basic data handling/Add Time Delta
ComfyUI Node

Add Time Delta

Now Plus Three Days, the Way Math Should Work

By StableLlama·Created about a year ago·Updated 4 days ago· 48
Add Time Delta
  • datetime
  • delta
  • DATETIME

"Three days from now" is a piece of arithmetic, and Add Time Delta is the node that performs it. It takes a DATETIME and a TIMEDELTA, adds them, and returns a new DATETIME. Pair it with Time Now and Create Time Delta and you can compute "a week from now," "45 minutes ago-ish," or any other offset - without ever doing date math by hand.

How it works

From StableLlama's Basic data handling pack. Two required inputs:

  • datetime - a DATETIME, typically from TimeNow, TimeNowUTC, or TimeParse.
  • delta - a TIMEDELTA from Create Time Delta.

The node is a straight datetime + delta under the hood, so all the normal Python semantics apply: adding days rolls over month and year boundaries correctly (Jan 30 plus 5 days is Feb 4, not an error), and durations combine naturally. Output is a single DATETIME.

From there the result plugs into the rest of the pack - TimeFormat to render it as a string, TimeExtract to pull out its components, TimeToUnix to get a Unix timestamp, or TimeDifference to compare it against something else. It's a link in a chain, not a dead end.

Where you'd use it

  • Deadlines and expiry - now + days=1 is a "tomorrow" you can format into a filename or log.
  • Backup/rotation naming - generate "next run" timestamps ahead of time.
  • Offsetting parsed dates - take a date from a filename or config, push it forward, and format the result as a new filename.

The sibling TimeSubtractDelta is the mirror image - same inputs, subtracts instead. Reach for whichever direction your math runs.

Installing it

Search "Basic data handling" in ComfyUI Manager and restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling

Restart and it's available. No dependencies, no models.

Gotchas

The one thing that bites: both inputs are custom types. You can't type a number into delta - you have to construct it with Create Time Delta first, and both datetime and delta must come from this pack's nodes or compatible sources, or the wire won't connect. If your graph shows a red connection here, that's almost certainly what happened: you're feeding it a string or float instead of a real TIMEDELTA. Everything else just works, which is the point.

CategoryBasic/time

Inputs (2)

NameTypeDefaultDescription
datetimeDATETIME
deltaTIMEDELTA

Outputs (1)

NameTypeDescription
DATETIMEDATETIME