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
#!/usr/bin/env bash
stamp=
prefix="backup"
name="$prefix-$stamp.tgz"
echo "$name"
#!/usr/bin/env bash
stamp=
prefix="backup"
name="$prefix-$stamp.tgz"
echo "$name"
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.