Skip to content

Utilities

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

9 modules

ModuleDescription
Dodaj czasDodaj czas do daty
Formatuj dateSformatuj date do lancucha znakow
Parsuj dateParsuj lancuch znakow na date
Odejmij czasOdejmij czas od daty
Bieżąca data/godzinaPobierz bieżącą datę i godzinę
Opóźnienie/UśpienieWstrzymaj wykonanie przepływu pracy na określony czas
Skrót MD5Oblicz skrót MD5 tekstu
Losowa liczbaWygeneruj losową liczbę w zakresie
Losowy ciąg znakówWygeneruj losowy ciąg znaków lub UUID

Modules

Dodaj czas

datetime.add

Dodaj czas do daty

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
resultstringWynik operacji
timestampnumberWynik operacji

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

Formatuj date

datetime.format

Sformatuj date do lancucha znakow

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
resultstringWynik operacji
timestampnumberWynik operacji

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

Parsuj date

datetime.parse

Parsuj lancuch znakow na date

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
resultstringWynik operacji
timestampnumberWynik operacji
yearnumberWynik operacji
monthnumberZnacznik czasu Unix
daynumberSkladnik roku
hournumberSkladnik miesiaca
minutenumberSkladnik dnia
secondnumberSkladnik godziny

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

Odejmij czas

datetime.subtract

Odejmij czas od daty

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
resultstringWynik operacji
timestampnumberWynik operacji

Example: Subtract 7 days

yaml
datetime: now
days: 7

Example: Subtract 1 hour

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

Bieżąca data/godzina

utility.datetime.now

Pobierz bieżącą datę i godzinę

Parameters:

NameTypeRequiredDefaultDescription
formatselect (iso, unix, unix_ms, date, time, custom)NoisoFormat wyjściowy
custom_formatstringNo-Format Python strftime (jeśli format=custom)
timezonestringNoUTCFormat Python strftime (jeśli format=custom)

Output:

FieldTypeDescription
statusstringStrefa czasowa (domyślnie: UTC)
datetimestringStatus operacji (sukces/błąd)
timestampnumberStatus operacji (sukces/błąd)
isostringSformatowana data/godzina

Example: Example

yaml
format: iso

Example: Example

yaml
format: unix

Opóźnienie/Uśpienie

utility.delay

Wstrzymaj wykonanie przepływu pracy na określony czas

Parameters:

NameTypeRequiredDefaultDescription
duration_msnumberNo1000Jak długo czekać w milisekundach
duration_secondsnumberNo-Alternatywa: czas trwania w sekundach

Output:

FieldTypeDescription
statusstringAlternatywa: czas trwania w sekundach
waited_msnumberStatus operacji (sukces/błąd)

Example: Example

yaml
duration_seconds: 2

Example: Example

yaml
duration_ms: 500

Skrót MD5

utility.hash.md5

Oblicz skrót MD5 tekstu

Parameters:

NameTypeRequiredDefaultDescription
texttextYes-Tekst do zahashowania
encodingstringNoutf-8Tekst do zahashowania

Output:

FieldTypeDescription
statusstringKodowanie tekstu
hashstringKodowanie tekstu

Example: Example

yaml
text: Hello World

Losowa liczba

utility.random.number

Wygeneruj losową liczbę w zakresie

Parameters:

NameTypeRequiredDefaultDescription
minnumberNo0Wartość minimalna (włącznie)
maxnumberNo100Wartość minimalna (włącznie)
decimalsnumberNo0Wartość maksymalna (włącznie)

Output:

FieldTypeDescription
statusstringLiczba miejsc dziesiętnych (0 dla liczb całkowitych)
valuenumberStatus operacji (sukces/błąd)

Example: Example

yaml
min: 1
max: 100
decimals: 0

Example: Example

yaml
min: 0
max: 1
decimals: 2

Losowy ciąg znaków

utility.random.string

Wygeneruj losowy ciąg znaków lub UUID

Parameters:

NameTypeRequiredDefaultDescription
lengthnumberNo16Długość ciągu znaków
charsetselect (alphanumeric, letters, lowercase, uppercase, numbers, hex, uuid)NoalphanumericDługość ciągu znaków

Output:

FieldTypeDescription
statusstringStatus operacji (sukces/błąd)
valuestringStatus operacji (sukces/błąd)

Example: Example

yaml
length: 16
charset: alphanumeric

Example: Example

yaml
charset: uuid

Released under the Apache 2.0 License.