init
This commit is contained in:
+32
@@ -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",
|
||||
}
|
||||
Reference in New Issue
Block a user