commit a77bcf6ab845eb072c6bac347ef76946fcb19c4a Author: mervent Date: Mon Jun 8 14:23:37 2026 +0300 init diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..7a8574b --- /dev/null +++ b/__init__.py @@ -0,0 +1,32 @@ +from datetime import datetime + + +class DatetimeFormatString: + @classmethod + def INPUT_TYPES(cls): + return { + "required": { + "text": ("STRING", { + "default": "output_%Y_%m_%d_%H_%M", + "multiline": False, + "tooltip": "Use Python strftime codes: %Y %m %d %H %M %S etc.", + }), + } + } + + RETURN_TYPES = ("STRING",) + RETURN_NAMES = ("text",) + FUNCTION = "format_datetime" + CATEGORY = "utils" + + def format_datetime(self, text): + return (datetime.now().strftime(text),) + + +NODE_CLASS_MAPPINGS = { + "DatetimeFormatString": DatetimeFormatString, +} + +NODE_DISPLAY_NAME_MAPPINGS = { + "DatetimeFormatString": "Datetime Format String", +}