Extract Time Components:
The TimeExtract node is designed to simplify the process of breaking down a DATETIME object into its fundamental components, such as year, month, day, hour, minute, second, microsecond, and weekday. This node is particularly useful for AI artists and developers who need to manipulate or analyze specific parts of a date and time without dealing with complex date-time libraries. By providing a straightforward method to extract these components, the TimeExtract node enhances the flexibility and precision of time-related operations in your projects. It is especially beneficial when you need to perform operations based on specific time components, such as scheduling tasks or logging events.
Extract Time Components Input Parameters:
datetime
The datetime parameter is the core input for the TimeExtract node. It requires a DATETIME object, which represents a specific point in time. This parameter is crucial as it serves as the source from which all individual time components are extracted. There are no minimum, maximum, or default values for this parameter, as it simply needs to be a valid DATETIME object. The accuracy and relevance of the extracted components depend entirely on the datetime input provided.
Extract Time Components Output Parameters:
year
The year output represents the year component of the provided DATETIME object. It is an integer value that indicates the calendar year.
month
The month output is an integer representing the month of the year, ranging from 1 (January) to 12 (December).
day
The day output is an integer that specifies the day of the month, ranging from 1 to 31, depending on the month and year.
hour
The hour output is an integer indicating the hour of the day, using a 24-hour clock format, ranging from 0 to 23.
minute
The minute output is an integer representing the minute within the hour, ranging from 0 to 59.
second
The second output is an integer that specifies the second within the minute, ranging from 0 to 59.
microsecond
The microsecond output is an integer representing the microsecond component of the time, ranging from 0 to 999,999.
weekday
The weekday output is an integer that indicates the day of the week, where Monday is 0 and Sunday is 6. This is useful for determining the day of the week for scheduling or logging purposes.
Extract Time Components Usage Tips:
- Use the
TimeExtractnode when you need to perform operations based on specific components of a date and time, such as filtering events by month or scheduling tasks on specific weekdays. - Combine the
TimeExtractnode with other time manipulation nodes to create complex workflows that require precise time component handling, such as calculating time differences or formatting dates for display.
Extract Time Components Common Errors and Solutions:
Invalid DATETIME object
- Explanation: The input provided is not a valid
DATETIMEobject, which is required for the node to function correctly. - Solution: Ensure that the input is a properly formatted
DATETIMEobject. You can use nodes likeTimeParseto convert strings intoDATETIMEobjects if needed.
Missing DATETIME input
- Explanation: The
datetimeinput parameter is missing, preventing the node from extracting time components. - Solution: Provide a valid
DATETIMEobject as input to the node to enable it to extract the necessary components.
