ComfyUI > Nodes > Basic data handling > Parse Time String

ComfyUI Node: Parse Time String

Class Name

Basic data handling: TimeParse

Category
Basic/time
Author
StableLlama (Account age: 861days)
Extension
Basic data handling
Latest Updated
2026-05-07
Github Stars
0.04K

How to Install Basic data handling

Install this extension via the ComfyUI Manager by searching for Basic data handling
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Basic data handling in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Parse Time String Description

Converts date-time strings into `DATETIME` objects for easier manipulation and processing.

Parse Time String:

The TimeParse node is designed to convert a string representation of a date and time into a DATETIME object, using a specified format code. This node is particularly useful when you have date and time information in string format and need to perform operations or calculations that require a DATETIME object. By parsing the string into a DATETIME object, you can leverage the full power of date and time manipulation functions available in programming environments. This node simplifies the process of converting various date and time formats into a standardized object, making it easier to handle and process temporal data in your projects.

Parse Time String Input Parameters:

time_string

The time_string parameter is the input string that contains the date and time information you wish to parse. This string should be formatted according to the format_string parameter to ensure successful parsing. There are no specific minimum or maximum values for this parameter, but it must be a valid string that represents a date and time.

format_string

The format_string parameter specifies the format code that defines how the time_string should be interpreted. This format code follows the conventions used in Python's datetime.strptime method, allowing you to define the exact structure of the date and time in the time_string. The default value for this parameter is "%Y-%m-%d %H:%M:%S", which corresponds to a common date and time format. You can customize this format to match the structure of your input string, ensuring accurate parsing.

Parse Time String Output Parameters:

datetime

The datetime output parameter is a DATETIME object that represents the parsed date and time from the input time_string. This object allows you to perform various date and time operations, such as comparisons, arithmetic, and formatting. The datetime object is crucial for applications that require precise time calculations or scheduling.

Parse Time String Usage Tips:

  • Ensure that the time_string matches the structure defined by the format_string to avoid parsing errors.
  • Use the default format_string for standard date and time formats, or customize it to match specific formats used in your data.
  • Consider using this node in conjunction with other time manipulation nodes to perform complex date and time operations.

Parse Time String Common Errors and Solutions:

ValueError: time data '...' does not match format '...'

  • Explanation: This error occurs when the time_string does not match the structure defined by the format_string.
  • Solution: Verify that the time_string is correctly formatted according to the format_string. Adjust the format_string if necessary to match the input data.

TypeError: strptime() argument 1 must be str, not ...

  • Explanation: This error indicates that the time_string is not a valid string.
  • Solution: Ensure that the time_string parameter is a string. Convert any non-string inputs to a string format before parsing.

Parse Time String Related Nodes

Go back to the extension to check out more related nodes.
Basic data handling
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

Parse Time String