Untitled

mail@pastecode.io avatarunknown
plain_text
a month ago
393 B
2
Indexable
Never
#!/bin/bash

batch_id="20230829123045"  # Replace with your batch ID

# Extract components from batch ID
year="${batch_id:0:4}"
month="${batch_id:4:2}"
day="${batch_id:6:2}"
hour="${batch_id:8:2}"
minute="${batch_id:10:2}"
second="${batch_id:12:2}"

# Construct datetime string
datetime="$year-$month-$day $hour:$minute:$second"

echo "Batch ID: $batch_id"
echo "Converted Datetime: $datetime"