Nodes/JNComfy/Datetime Info
ComfyUI Node

Datetime Info

Pull year/month/day/hour apart from a DATETIME

By jn-jairo·Created 2 years ago·Updated 2 years ago· 5
Datetime Info
  • value
  • year
  • month
  • day
  • hour
  • minute
  • second
  • microsecond

Breaks a single DATETIME value into its individual components - year, month, day, hour, minute, second, microsecond - each as its own INT output. It's the decomposition counterpart to JN_DatetimeFormat in JNComfy's (jn-jairo/jn_comfyui) small datetime toolkit: where DatetimeFormat gives you a single formatted string, this gives you the raw numbers so you can do math or comparisons on them individually.

Why you'd want it

A formatted string is great for a filename or a log line, but it's a dead end if you actually need to do something with a piece of the date - check whether the hour is past a certain value, build a folder path per-day using just the day number, or feed the year into a comparison node. Formatting collapses everything into text; this node keeps everything as usable numbers.

How it works

There's one input, value (DATETIME), and it doesn't touch or transform it - it just reads the standard components off the value, the same seven fields any datetime object exposes, and returns each separately.

The inputs and outputs that matter

  • value (DATETIME) - the timestamp to break down. Typically wired in from JN_DatetimeNow.

Seven outputs, all INT, all straightforward: year, month, day, hour, minute, second, microsecond. Wire whichever one you actually need into a JN_LogicOperation for a comparison, a JN_MathOperation for calculation, or a Text Concatenation node if you're rebuilding a custom string manually instead of using JN_DatetimeFormat.

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 discussion anywhere we could find and no entry in our knowledge base. For a plain decomposition node like this one, that's not a real gap - the behavior is exactly what the field names suggest.

Common issues & troubleshooting

You only need one piece and this feels heavy for that. It's not doing anything expensive - all seven outputs are computed at once regardless of which ones you actually wire forward, so there's no cost to leaving five of them unconnected if you only need day or hour.

Values look off by an hour, or in the wrong timezone. This node just reads whatever's already on the DATETIME object you feed it - if the source of that value (most likely JN_DatetimeNow) captured it in a timezone you didn't expect (local time vs. UTC, for instance), that discrepancy is coming from upstream, not from this node reinterpreting anything.

You wanted a duration broken down, not a point in time. Different node - JN_TimedeltaInfo does the same kind of decomposition, but for a TIMEDELTA (a duration between two points) rather than a DATETIME (a specific point in time). If you subtracted two datetimes to get an elapsed-time value, that's a TIMEDELTA, and this node isn't the right one for it.

CategoryJN/Other

Inputs (1)

NameTypeDefaultDescription
valueDATETIME

Outputs (7)

NameTypeDescription
yearINT
monthINT
dayINT
hourINT
minuteINT
secondINT
microsecondINT