Nodes/Comfyui-Qb-Date-Nodes/DateTime Formatter
ComfyUI Node

DateTime Formatter

Stamp the Current Date & Time Into Your ComfyUI Workflow

By Q-Bug4·Created 2 years ago·Updated about a year ago· 6
DateTime Formatter
    • formatted_datetime
    formatyyyy-MM-dd-hhmmss

    If you've ever opened your output folder and found forty images all overwriting each other because filename_prefix was just "ComfyUI", this node is the fix. DateTime Formatter grabs the current system time the moment the node runs and turns it into a string - 2026-08-04-142530, or whatever pattern you tell it - that you can feed straight into a filename, a folder name, or a log entry. It's not glamorous, but it's the kind of small utility node that quietly saves you from clobbering your own renders.

    How it works

    There's exactly one input: format, a plain string, defaulting to yyyy-MM-dd-hhmmss. Under the hood the node takes that pattern, swaps the tokens for Python's strftime codes, and stamps out the current date and time. You don't write %Y-%m-%d yourself - you write it in these tokens:

    • yyyy - full year (2026)
    • YY - two-digit year (26)
    • MM - month, 01–12
    • dd - day of month, 01–31
    • hh - hour, 24-hour clock, 00–23
    • mm - minutes, 00–59
    • ss - seconds, 00–59

    Mix and match them however you like - MM-dd-YY gives you 08-04-26, yyyy/MM/dd gives you a path-shaped string if you want date-based subfolders. The one output is formatted_datetime, a plain STRING carrying the result.

    One thing worth knowing: the node's IS_CHANGED deliberately always reports "changed." That's not a bug, it's the whole point - every time you hit Queue, this node re-evaluates and produces a fresh timestamp instead of ComfyUI caching the old one. If it cached, you'd get the same string on every run and defeat the purpose entirely.

    What you actually wire it into

    The overwhelmingly common use is filename_prefix on a Save Image (or Save Video) node. Right-click the Save Image node, convert filename_prefix from a widget to an input, then plug formatted_datetime in - you'll see people doing exactly this on r/comfyui when their outputs start overwriting each other. Combine it with a string-concat node if you want "render_" + formatted_datetime instead of the bare timestamp. Same idea works for organizing outputs into dated folders if your format string includes slashes.

    Installing it

    There's no install section spelled out beyond the standard path: open ComfyUI Manager, search "Comfyui-Qb-Date-Nodes", install, restart. Or do it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Q-Bug4/Comfyui-Qb-DateNodes
    

    Restart ComfyUI and it'll show up under the utils category. No requirements.txt, no model downloads, nothing extra to fetch - it's pure Python standard library (datetime/strftime) wrapped in a node. This is about as lightweight as custom nodes get, so if it's not showing up, it's almost always a plain "did ComfyUI actually restart and rescan custom_nodes" issue rather than a dependency problem.

    Where people trip up

    The one real gotcha is format syntax. The node converts your pattern to strftime internally, but the pattern you type uses yyyy/MM/dd tokens, not raw %Y-%m-%d strftime codes. Type %Y-%m-%d into the format field and you'll get a ValueError instead of a date - the node isn't reading strftime directly, it's translating a different token set first. Stick to the letter tokens above and you're fine.

    Second: hh is 24-hour, not 12-hour. If you're building a human-readable filename and expect hh to top out at 12, it won't - 3pm comes out as 15, not 03. Not a bug, just worth knowing before you're confused why your afternoon renders all say "hour 14."

    Beyond that, there isn't much to break - it's a single string input, no external calls, no state. If you need heavier date math (adding days, computing durations, comparing timestamps) this pack doesn't do that; you're better off with a general expression node like rgthree's Power Puter, which picked up now()/strftime() support of its own in mid-2026. For the common case - "put today's date in my filename" - this one-input node is honestly the simpler tool to reach for than dragging a full expression evaluator into the graph for one string.

    Categoryutils

    Inputs (1)

    NameTypeDefaultDescription
    formatSTRINGyyyy-MM-dd-hhmmss

    Outputs (1)

    NameTypeDescription
    formatted_datetimeSTRING