Nodes/JPS Custom Nodes for ComfyUI/Get Date Time String (JPS)
ComfyUI Node

Get Date Time String (JPS)

A timestamp string that actually refreshes on every run

By JPS-GER·Created 3 years ago·Updated 2 years ago· 100
Get Date Time String (JPS)
    • time_format
    style

    A naive "give me the current date and time" node runs straight into one of ComfyUI's less obvious behaviors: the graph caches a node's output between queue runs if none of its inputs have changed, and a plain timestamp node has no inputs to change - so a lazy implementation would compute the time once, then keep handing back that same stale string on every subsequent generation until you touched something else in the graph. The pack's own README calls this out directly: this node has "extra code to make sure it will not use cached data," which is a small but real fix to a real ComfyUI footgun.

    The interface is one dropdown, style, offering a set of format patterns - full date-and-time stamps down to the second (%Y%m%d%H%M%S), date-only, time-only, and variants with dashes, underscores, or spaces between the pieces. Pick the format that matches what you need, and the single output time_format is the resulting string, freshly computed on every execution regardless of whether anything upstream changed.

    Where this actually matters. The obvious use is filenames - feeding this into Text Concatenate (JPS) alongside a static prefix, then into a SaveImage node's filename field, so every batch gets a genuinely unique, sortable name instead of ComfyUI's own auto-increment counter or (worse) overwriting the last output because two runs landed on the same filename pattern. It's also useful for logging or tagging metadata within a workflow where you want a record of exactly when a given generation happened, not just its position in a sequence.

    Installing it. Via ComfyUI Manager - search "JPS Custom Nodes for ComfyUI" - or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JPS-GER/ComfyUI_JPS-Nodes.git
    

    Restart and it's under JPS Nodes/Text. Delete an older copy of the pack first if you're reinstalling, per the author's own guidance. No models, no extra Python dependencies - this is a thin wrapper around Python's own datetime formatting.

    Troubleshooting. If you ever do see a stale timestamp despite the anti-caching fix, the most likely explanation isn't this node - it's that ComfyUI never actually re-ran that part of the graph at all, because everything upstream of it was cached too and the queue decided nothing needed re-execution. Force a fresh run (changing the seed, or hitting the "run" button after a genuine input change elsewhere) rather than assuming the timestamp node itself has stopped working. The other thing worth double-checking: the format strings use standard strftime-style codes, so if your filename ends up looking wrong (missing separators, wrong field order), it's almost always the wrong dropdown option selected rather than a bug - compare the style value against the output directly with a Preview/Text node before chasing it further downstream.

    CategoryJPS Nodes/Text

    Inputs (1)

    NameTypeDefaultDescription
    styleCOMBO13 options: %Y%m%d%H%M%S, %Y%m%d%H%M, %Y%m%d, %Y-%m-%d-%H_%M_%S, %Y-%m-%d-%H_%M, %Y-%m-%d, +7

    Outputs (1)

    NameTypeDescription
    time_formatSTRING