Skip to content

Utilities

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

9 modules

ModuleDescription
Agregar tiempoAgregar tiempo a fecha y hora
Formatear fecha y horaFormatear fecha y hora a cadena
Parsear fecha y horaParsear cadena a fecha y hora
Restar tiempoRestar tiempo de fecha y hora
Fecha/hora actualObtener fecha y hora actual
Retraso/EsperaPausar ejecucion de flujo de trabajo por duracion especificada
Hash MD5Calcular hash MD5 de texto
Numero aleatorioGenerar numero aleatorio en rango
Cadena aleatoriaGenerar cadena aleatoria o UUID

Modules

Agregar tiempo

datetime.add

Agregar tiempo a fecha y hora

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
resultstringEl resultado de la operacion
timestampnumberEl resultado de la operacion

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

Formatear fecha y hora

datetime.format

Formatear fecha y hora a cadena

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
resultstringEl resultado de la operacion
timestampnumberEl resultado de la operacion

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

Parsear fecha y hora

datetime.parse

Parsear cadena a fecha y hora

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
resultstringEl resultado de la operacion
timestampnumberEl resultado de la operacion
yearnumberEl resultado de la operacion
monthnumberMarca de tiempo Unix
daynumberComponente de ano
hournumberComponente de mes
minutenumberComponente de dia
secondnumberComponente de hora

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

Restar tiempo

datetime.subtract

Restar tiempo de fecha y hora

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
resultstringEl resultado de la operacion
timestampnumberEl resultado de la operacion

Example: Subtract 7 days

yaml
datetime: now
days: 7

Example: Subtract 1 hour

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

Fecha/hora actual

utility.datetime.now

Obtener fecha y hora actual

Parameters:

NameTypeRequiredDefaultDescription
formatselect (iso, unix, unix_ms, date, time, custom)NoisoFormato de salida
custom_formatstringNo-Formato strftime de Python (si format=custom)
timezonestringNoUTCFormato strftime de Python (si format=custom)

Output:

FieldTypeDescription
statusstringZona horaria (predeterminado: UTC)
datetimestringEstado de la operacion (exito/error)
timestampnumberEstado de la operacion (exito/error)
isostringFecha/hora formateada

Example: Example

yaml
format: iso

Example: Example

yaml
format: unix

Retraso/Espera

utility.delay

Pausar ejecucion de flujo de trabajo por duracion especificada

Parameters:

NameTypeRequiredDefaultDescription
duration_msnumberNo1000Cuanto tiempo esperar en milisegundos
duration_secondsnumberNo-Alternativa: duracion en segundos

Output:

FieldTypeDescription
statusstringAlternativa: duracion en segundos
waited_msnumberEstado de la operacion (exito/error)

Example: Example

yaml
duration_seconds: 2

Example: Example

yaml
duration_ms: 500

Hash MD5

utility.hash.md5

Calcular hash MD5 de texto

Parameters:

NameTypeRequiredDefaultDescription
texttextYes-Texto a hashear
encodingstringNoutf-8Texto a hashear

Output:

FieldTypeDescription
statusstringCodificacion de texto
hashstringCodificacion de texto

Example: Example

yaml
text: Hello World

Numero aleatorio

utility.random.number

Generar numero aleatorio en rango

Parameters:

NameTypeRequiredDefaultDescription
minnumberNo0Valor minimo (inclusivo)
maxnumberNo100Valor minimo (inclusivo)
decimalsnumberNo0Valor maximo (inclusivo)

Output:

FieldTypeDescription
statusstringNumero de decimales (0 para enteros)
valuenumberEstado de la operacion (exito/error)

Example: Example

yaml
min: 1
max: 100
decimals: 0

Example: Example

yaml
min: 0
max: 1
decimals: 2

Cadena aleatoria

utility.random.string

Generar cadena aleatoria o UUID

Parameters:

NameTypeRequiredDefaultDescription
lengthnumberNo16Longitud de cadena
charsetselect (alphanumeric, letters, lowercase, uppercase, numbers, hex, uuid)NoalphanumericLongitud de cadena

Output:

FieldTypeDescription
statusstringEstado de la operacion (exito/error)
valuestringEstado de la operacion (exito/error)

Example: Example

yaml
length: 16
charset: alphanumeric

Example: Example

yaml
charset: uuid

Released under the Apache 2.0 License.