Nodes/wlsh_nodes/Time String (WLSH)
ComfyUI Node

Time String (WLSH)

Time String (WLSH)

By wallish77·Created 3 years ago·Updated 2 years ago· 144
Time String (WLSH)
    • time_format
    style

    A small, single-purpose node: pick a timestamp style from a dropdown, get a formatted time string out. Per the pack's own description, it returns the current time formatted according to whichever style you chose - no manual date-formatting, no remembering strftime syntax off the top of your head.

    Where this actually earns a place in your graph is filenames and debugging. WLSH's save nodes (Image Save with Prompt, Image Save with Prompt File, and the info variant) all support a %time placeholder in their filename field, and that placeholder gets rendered using a time_format value - either the default %Y-%m-%d-%H%M%S pattern, or whatever you wire into their optional time_format input. This node's output plugs directly into that same slot, so instead of typing a raw strftime pattern into a text box and hoping you got the escape codes right, you pick one of six standard, pre-built patterns from a dropdown and wire the result straight across. It also doubles as a plain "what time did this run happen" string if you just want a timestamp somewhere in your graph for logging or debugging purposes, independent of any save node.

    Input: style, a six-option enum covering the common variations - %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, and %Y-%m-%d - basically every reasonable combination of date-only vs date-plus-time, with or without seconds, in either compact or hyphenated form. Output: time_format, a single STRING.

    Installing it: through ComfyUI Manager, search "wlsh_nodes"; or clone the pack directly:

    cd ComfyUI/custom_nodes
    git clone https://github.com/wallish77/wlsh_nodes
    

    Restart ComfyUI. No models, no extra dependencies - it's a formatting utility, nothing to download beyond the pack itself.

    A couple of things to keep straight. The output socket is named time_format - the exact same name as the optional input field on WLSH's save nodes - which is a strong hint at the intended pairing: wire this node's output straight into that field rather than typing a pattern by hand. And because it reads the current time at the moment the node executes, running the same workflow twice in a row (even seconds apart) will typically produce a different string each time, which is exactly what you want for unique filenames but worth knowing if you were expecting a fixed, reproducible value for some other purpose.

    Troubleshooting: there's not much to go wrong on a node this small. If a downstream filename isn't picking up the format you expect, check that this node's output is actually connected to the right input - it's easy in a busy graph to have time_format and a plain %time placeholder both present and only one of them actually wired correctly. And remember the format only applies wherever %time is used - if you're not using that placeholder anywhere downstream, this node's output has nothing to attach to.

    CategoryWLSH Nodes/text

    Inputs (1)

    NameTypeDefaultDescription
    styleCOMBO6 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

    Outputs (1)

    NameTypeDescription
    time_formatSTRING