To work on the current timestamp and not the time when your fixed variable is defined, this trick is to use the function and not the variable:
#!/bin/bash
# Define a timestamp function
timestamp() {
date +"%T" # current time
}
# do something...
timestamp # print timestamp
# do something else...
timestamp # print another timestamp
# continue...
If you don't like this format given by the %T specifier you can combine the other time conversion specifiers accepted through date. For the GNU date, you can find the list of the official documentation here
Want to be a Linux expert? Come and join this Linux course
Do check out the video below