Timedelta Info
Break a duration into days, hours, minutes, seconds
- value
- days
- hours
- minutes
- seconds
- microseconds
- total_seconds
Takes a TIMEDELTA - a duration, not a point in time - and breaks it into the pieces you'd actually want to display or check: days, hours, minutes, seconds, microseconds, and the whole thing as a single float of total seconds. It's a small part of JNComfy's (jn-jairo/jn_comfyui) datetime toolkit, and the natural companion to a value produced by subtracting two DATETIMEs.
Why you'd want it
If you're timing something inside a graph - how long a branch took, how much time has passed since a run started - you end up with a duration rather than a point in time, and durations aren't naturally readable as a single number. "347.82 seconds" is correct but not what you'd put in a log line; "5 minutes, 47 seconds" is. This node does that decomposition for you instead of making you do the modulo arithmetic by hand.
A plausible way you'd end up with a TIMEDELTA to feed it in the first place: grab a timestamp with JN_DatetimeNow before some slow branch of your graph, grab another one after, and subtract them (JN_MathOperation's a - b accepts any type, including datetimes, since both operands are the generic * wildcard). The result is a TIMEDELTA - feed that here to get it broken down.
How it works
There's exactly one input, a TIMEDELTA value, and it doesn't transform anything - it just reads the standard duration components off the object and returns each as its own typed output.
The inputs and outputs that matter
value(TIMEDELTA) - the duration to break down. Required, single input.
Six outputs, all read-only decompositions of the same duration:
days,hours,minutes,seconds,microseconds(all INT) - the individual components.total_seconds(FLOAT) - the whole duration collapsed to one number, useful for logging, comparison, or feeding into JN_MathOperation/JN_LogicOperation if you want to gate something on "did this take longer than N seconds."
How to install it
Via ComfyUI Manager: search "JNComfy", install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/jn-jairo/jn_comfyui
then restart ComfyUI. This is a small, single-author pack with no meaningful community footprint anywhere we could find and no entry in our knowledge base - for a straightforward decomposition node like this one, that's not much of a loss, but don't expect prior art if you're trying to figure out an edge case.
Common issues & troubleshooting
Nothing feeds it a TIMEDELTA. This is the practical sticking point - ComfyUI/JNComfy doesn't have an obvious single node labeled "subtract two datetimes," so you have to build the TIMEDELTA yourself, most naturally via JN_MathOperation's subtraction operating on two DATETIME values. If you're getting a type error here, check that whatever you wired in is actually a TIMEDELTA and not a raw DATETIME or a plain number.
days/hours/etc. don't add up the way you expect. These decompose the way Python's own timedelta does - days and seconds/microseconds are the normalized components, not simple division of the total into hours/minutes/seconds buckets, so hours specifically is not present as its own attribute on a raw Python timedelta and this node is presumably deriving it from the total - if the numbers look odd, cross-check against total_seconds, which is the unambiguous ground truth.
You actually want the parts of a specific point in time, not a duration. Wrong node - that's JN_DatetimeInfo, which breaks down a DATETIME (year/month/day/hour/minute/second) rather than a TIMEDELTA.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | TIMEDELTA | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| days | INT | — |
| hours | INT | — |
| minutes | INT | — |
| seconds | INT | — |
| microseconds | INT | — |
| total_seconds | FLOAT | — |