Skip to content

Utilities

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

9 modules

ModuleDescription
Aggiungi TempoAggiungi tempo a datetime
Formatta DateTimeFormatta datetime in stringa
Analizza DateTimeAnalizza stringa in datetime
Sottrai TempoSottrai tempo da datetime
Data/Ora CorrenteOttieni data e ora correnti
Ritardo/PausaMetti in pausa esecuzione workflow per durata specificata
Hash MD5Calcola hash MD5 del testo
Numero CasualeGenera numero casuale in intervallo
Stringa CasualeGenera stringa casuale o UUID

Modules

Aggiungi Tempo

datetime.add

Aggiungi tempo a 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
resultstringIl risultato operazione
timestampnumberIl risultato operazione

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

Formatta DateTime

datetime.format

Formatta datetime in stringa

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
resultstringIl risultato operazione
timestampnumberIl risultato operazione

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

Analizza DateTime

datetime.parse

Analizza stringa in 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
resultstringIl risultato operazione
timestampnumberIl risultato operazione
yearnumberIl risultato operazione
monthnumberTimestamp Unix
daynumberComponente anno
hournumberComponente mese
minutenumberComponente giorno
secondnumberComponente ora

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

Sottrai Tempo

datetime.subtract

Sottrai tempo da 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
resultstringIl risultato operazione
timestampnumberIl risultato operazione

Example: Subtract 7 days

yaml
datetime: now
days: 7

Example: Subtract 1 hour

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

Data/Ora Corrente

utility.datetime.now

Ottieni data e ora correnti

Parameters:

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

Output:

FieldTypeDescription
statusstringFuso orario (default: UTC)
datetimestringStato operazione (successo/errore)
timestampnumberStato operazione (successo/errore)
isostringData/ora formattata

Example: Example

yaml
format: iso

Example: Example

yaml
format: unix

Ritardo/Pausa

utility.delay

Metti in pausa esecuzione workflow per durata specificata

Parameters:

NameTypeRequiredDefaultDescription
duration_msnumberNo1000Quanto attendere in millisecondi
duration_secondsnumberNo-Alternativa: durata in secondi

Output:

FieldTypeDescription
statusstringAlternativa: durata in secondi
waited_msnumberStato operazione (successo/errore)

Example: Example

yaml
duration_seconds: 2

Example: Example

yaml
duration_ms: 500

Hash MD5

utility.hash.md5

Calcola hash MD5 del testo

Parameters:

NameTypeRequiredDefaultDescription
texttextYes-Testo da hashare
encodingstringNoutf-8Testo da hashare

Output:

FieldTypeDescription
statusstringCodifica testo
hashstringCodifica testo

Example: Example

yaml
text: Hello World

Numero Casuale

utility.random.number

Genera numero casuale in intervallo

Parameters:

NameTypeRequiredDefaultDescription
minnumberNo0Valore minimo (incluso)
maxnumberNo100Valore minimo (incluso)
decimalsnumberNo0Valore massimo (incluso)

Output:

FieldTypeDescription
statusstringNumero di cifre decimali (0 per interi)
valuenumberStato operazione (successo/errore)

Example: Example

yaml
min: 1
max: 100
decimals: 0

Example: Example

yaml
min: 0
max: 1
decimals: 2

Stringa Casuale

utility.random.string

Genera stringa casuale o UUID

Parameters:

NameTypeRequiredDefaultDescription
lengthnumberNo16Lunghezza stringa
charsetselect (alphanumeric, letters, lowercase, uppercase, numbers, hex, uuid)NoalphanumericLunghezza stringa

Output:

FieldTypeDescription
statusstringStato operazione (successo/errore)
valuestringStato operazione (successo/errore)

Example: Example

yaml
length: 16
charset: alphanumeric

Example: Example

yaml
charset: uuid

Released under the Apache 2.0 License.