Skip to content

Utilities

Datetime operations, delay, MD5 hash, and random utilities.

9 modules

ModuleDescription
Add TimeAdd time to datetime
Format DateTimeFormat datetime to string
Parse DateTimeParse string to datetime
Subtract TimeSubtract time from datetime
Current Date/TimeGet current date and time
Delay/SleepPause workflow execution for specified duration
MD5 HashCalculate MD5 hash of text
Random NumberGenerate random number in range
Random StringGenerate random string or UUID

Modules

Add Time

datetime.add

Add time to datetime

Parameters:

NameTypeRequiredDefaultDescription
datetimestringNonowEnter "now" for current time, or ISO 8601 format (e.g., 2024-01-30T14:30:00)
daysnumberNo0Number of days to add (positive) or subtract (negative)
hoursnumberNo0Number of hours to add (positive) or subtract (negative)
minutesnumberNo0Number of minutes to add (positive) or subtract (negative)
secondsnumberNo0Number of seconds to add (positive) or subtract (negative)

Output:

FieldTypeDescription
resultstringThe operation result
timestampnumberThe operation result

Example: Add 7 days

yaml
datetime: now
days: 7

Example: Add 2 hours 30 minutes

yaml
datetime: 2024-01-15T10:00:00
hours: 2
minutes: 30

Format DateTime

datetime.format

Format datetime to string

Parameters:

NameTypeRequiredDefaultDescription
datetimestringNonowEnter "now" for current time, or ISO 8601 format (e.g., 2024-01-30T14:30:00)
formatselect (%Y-%m-%d, %Y-%m-%d %H:%M:%S, %Y/%m/%d, %d/%m/%Y, %m/%d/%Y, %Y年%m月%d日, %B %d, %Y, %d %b %Y, %H:%M:%S, %H:%M, %I:%M %p, %Y%m%d, %Y-%m-%dT%H:%M:%SZ, %a, %d %b %Y %H:%M:%S)No%Y-%m-%d %H:%M:%SSelect a format or enter custom strftime pattern

Output:

FieldTypeDescription
resultstringThe operation result
timestampnumberThe operation result

Example: Format current time

yaml
datetime: now
format: %Y-%m-%d %H:%M:%S

Example: Custom date format

yaml
datetime: 2024-01-15T10:30:00
format: %B %d, %Y

Parse DateTime

datetime.parse

Parse string to datetime

Parameters:

NameTypeRequiredDefaultDescription
datetime_stringstringYes-DateTime string to parse (ISO 8601 format recommended)
formatselect (%Y-%m-%d, %Y-%m-%d %H:%M:%S, %Y/%m/%d, %d/%m/%Y, %m/%d/%Y, %Y年%m月%d日, %B %d, %Y, %d %b %Y, %H:%M:%S, %H:%M, %I:%M %p, %Y%m%d, %Y-%m-%dT%H:%M:%SZ, %a, %d %b %Y %H:%M:%S)No%Y-%m-%d %H:%M:%SSelect a format or enter custom strftime pattern

Output:

FieldTypeDescription
resultstringThe operation result
timestampnumberThe operation result
yearnumberThe operation result
monthnumberUnix timestamp
daynumberYear component
hournumberMonth component
minutenumberDay component
secondnumberHour component

Example: Parse ISO format

yaml
datetime_string: 2024-01-15T10:30:00

Example: Parse custom format

yaml
datetime_string: January 15, 2024
format: %B %d, %Y

Subtract Time

datetime.subtract

Subtract time from datetime

Parameters:

NameTypeRequiredDefaultDescription
datetimestringNonowEnter "now" for current time, or ISO 8601 format (e.g., 2024-01-30T14:30:00)
daysnumberNo0Number of days to add (positive) or subtract (negative)
hoursnumberNo0Number of hours to add (positive) or subtract (negative)
minutesnumberNo0Number of minutes to add (positive) or subtract (negative)
secondsnumberNo0Number of seconds to add (positive) or subtract (negative)

Output:

FieldTypeDescription
resultstringThe operation result
timestampnumberThe operation result

Example: Subtract 7 days

yaml
datetime: now
days: 7

Example: Subtract 1 hour

yaml
datetime: 2024-01-15T10:00:00
hours: 1

Current Date/Time

utility.datetime.now

Get current date and time

Parameters:

NameTypeRequiredDefaultDescription
formatselect (iso, unix, unix_ms, date, time, custom)NoisoOutput format
custom_formatstringNo-Python strftime format (if format=custom)
timezonestringNoUTCPython strftime format (if format=custom)

Output:

FieldTypeDescription
statusstringTimezone (default: UTC)
datetimestringOperation status (success/error)
timestampnumberOperation status (success/error)
isostringFormatted date/time

Example: Example

yaml
format: iso

Example: Example

yaml
format: unix

Delay/Sleep

utility.delay

Pause workflow execution for specified duration

Parameters:

NameTypeRequiredDefaultDescription
duration_msnumberNo1000How long to wait in milliseconds
duration_secondsnumberNo-Alternative: duration in seconds

Output:

FieldTypeDescription
statusstringAlternative: duration in seconds
waited_msnumberOperation status (success/error)

Example: Example

yaml
duration_seconds: 2

Example: Example

yaml
duration_ms: 500

MD5 Hash

utility.hash.md5

Calculate MD5 hash of text

Parameters:

NameTypeRequiredDefaultDescription
texttextYes-Text to hash
encodingstringNoutf-8Text to hash

Output:

FieldTypeDescription
statusstringText encoding
hashstringText encoding

Example: Example

yaml
text: Hello World

Random Number

utility.random.number

Generate random number in range

Parameters:

NameTypeRequiredDefaultDescription
minnumberNo0Minimum value (inclusive)
maxnumberNo100Minimum value (inclusive)
decimalsnumberNo0Maximum value (inclusive)

Output:

FieldTypeDescription
statusstringNumber of decimal places (0 for integers)
valuenumberOperation status (success/error)

Example: Example

yaml
min: 1
max: 100
decimals: 0

Example: Example

yaml
min: 0
max: 1
decimals: 2

Random String

utility.random.string

Generate random string or UUID

Parameters:

NameTypeRequiredDefaultDescription
lengthnumberNo16String length
charsetselect (alphanumeric, letters, lowercase, uppercase, numbers, hex, uuid)NoalphanumericString length

Output:

FieldTypeDescription
statusstringOperation status (success/error)
valuestringOperation status (success/error)

Example: Example

yaml
length: 16
charset: alphanumeric

Example: Example

yaml
charset: uuid

Released under the Apache 2.0 License.