Date and Time Inputs
Timestamp Name
Build a Stable Label
Timestamp strings are useful in generated names when the value is provided explicitly. This keeps the script reproducible and the name predictable.
Program
Play the script to choose the timestamp and see the generated artifact name.
timestamp_name_plan.sh
Replay: real traced execution (multi-file project)
#!/usr/bin/env bash
stamp="20260601T120000Z"
prefix="backup"
name="$prefix-$stamp.tgz"
echo "$name"
#!/usr/bin/env bash
stamp="20260601T121500Z"
prefix="backup"
name="$prefix-$stamp.tgz"
echo "$name"
stamp ← 20260601T120000Z
3stamp="20260601T120000Z"4prefix="backup"values this step20260601T120000Zstampprefix ← backup
3stamp="20260601T120000Z"4prefix="backup"5name="$prefix-$stamp.tgz"values this stepbackupprefixname ← backup-20260601T120000Z.tgz
4prefix="backup"5name="$prefix-$stamp.tgz"6echo "$name"values this stepbackup-20260601T120000Z.tgznamebackupprefix20260601T120000Zstampecho "$name"
5name="$prefix-$stamp.tgz"6echo "$name"outputbackup-20260601T120000Z.tgzvalues this stepbackup-20260601T120000Z.tgzname
stamp ← 20260601T121500Z
3stamp="20260601T121500Z"4prefix="backup"values this step20260601T121500Zstampprefix ← backup
3stamp="20260601T121500Z"4prefix="backup"5name="$prefix-$stamp.tgz"values this stepbackupprefixname ← backup-20260601T121500Z.tgz
4prefix="backup"5name="$prefix-$stamp.tgz"6echo "$name"values this stepbackup-20260601T121500Z.tgznamebackupprefix20260601T121500Zstampecho "$name"
5name="$prefix-$stamp.tgz"6echo "$name"outputbackup-20260601T121500Z.tgzvalues this stepbackup-20260601T121500Z.tgzname
timestamp
A timestamp label records a specific instant-like value.
UTC suffix
`Z` conventionally marks a UTC timestamp string.
reproducible name
Passing the timestamp in makes the script output predictable.