Skip to content

Utilities

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

9 modules

ModuleDescription
時間を加算日時に時間を加算
日時フォーマット日時を文字列にフォーマット
日時パース文字列を日時にパース
時間を減算日時から時間を減算
現在日時現在の日付と時刻を取得する
遅延/スリープ指定した時間だけワークフローの実行を一時停止する
MD5ハッシュテキストのMD5ハッシュを計算する
ランダム数値範囲内のランダムな数値を生成する
ランダム文字列ランダムな文字列またはUUIDを生成する

Modules

時間を加算

datetime.add

日時に時間を加算

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
resultstring操作結果
timestampnumber操作結果

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

日時フォーマット

datetime.format

日時を文字列にフォーマット

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
resultstring操作結果
timestampnumber操作結果

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

日時パース

datetime.parse

文字列を日時にパース

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
resultstring操作結果
timestampnumber操作結果
yearnumber操作結果
monthnumberUnixタイムスタンプ
daynumber年の部分
hournumber月の部分
minutenumber日の部分
secondnumber時の部分

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

時間を減算

datetime.subtract

日時から時間を減算

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
resultstring操作結果
timestampnumber操作結果

Example: Subtract 7 days

yaml
datetime: now
days: 7

Example: Subtract 1 hour

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

現在日時

utility.datetime.now

現在の日付と時刻を取得する

Parameters:

NameTypeRequiredDefaultDescription
formatselect (iso, unix, unix_ms, date, time, custom)Noiso出力フォーマット
custom_formatstringNo-Python strftimeフォーマット(format=customの場合)
timezonestringNoUTCタイムゾーン(デフォルト: UTC)

Output:

FieldTypeDescription
statusstring操作ステータス
datetimestringフォーマットされた日時
timestampnumberUnixタイムスタンプ(ミリ秒)
isostringISO形式の日時

Example: Example

yaml
format: iso

Example: Example

yaml
format: unix

遅延/スリープ

utility.delay

指定した時間だけワークフローの実行を一時停止する

Parameters:

NameTypeRequiredDefaultDescription
duration_msnumberNo1000待機時間(ミリ秒)
duration_secondsnumberNo-代替: 待機時間(秒)

Output:

FieldTypeDescription
statusstring操作ステータス
waited_msnumber待機した時間(ミリ秒)

Example: Example

yaml
duration_seconds: 2

Example: Example

yaml
duration_ms: 500

MD5ハッシュ

utility.hash.md5

テキストのMD5ハッシュを計算する

Parameters:

NameTypeRequiredDefaultDescription
texttextYes-ハッシュするテキスト
encodingstringNoutf-8テキストエンコーディング

Output:

FieldTypeDescription
statusstring操作ステータス
hashstringMD5ハッシュ値

Example: Example

yaml
text: Hello World

ランダム数値

utility.random.number

範囲内のランダムな数値を生成する

Parameters:

NameTypeRequiredDefaultDescription
minnumberNo0最小値(含む)
maxnumberNo100最大値(含む)
decimalsnumberNo0小数点以下の桁数(0で整数)

Output:

FieldTypeDescription
statusstring操作ステータス
valuenumber生成されたランダム値

Example: Example

yaml
min: 1
max: 100
decimals: 0

Example: Example

yaml
min: 0
max: 1
decimals: 2

ランダム文字列

utility.random.string

ランダムな文字列またはUUIDを生成する

Parameters:

NameTypeRequiredDefaultDescription
lengthnumberNo16文字列の長さ
charsetselect (alphanumeric, letters, lowercase, uppercase, numbers, hex, uuid)Noalphanumeric使用する文字セット

Output:

FieldTypeDescription
statusstring操作ステータス
valuestring生成されたランダム文字列

Example: Example

yaml
length: 16
charset: alphanumeric

Example: Example

yaml
charset: uuid

Released under the Apache 2.0 License.