I have used the following statements to get the current time.
print \"$query executed successfully at \",localtime; print \"$query executed successfully
If you want to get the timestamp of the current time, you can just use function time()