Last active 10 months ago

Simple variables for the current date and time, great to include in logs for small scripts

gaiety's Avatar gaiety revised this gist 10 months ago. Go to revision

1 file changed, 4 insertions

date-time-bash.sh(file created)

@@ -0,0 +1,4 @@
1 + currentDate=$(date +"%m_%d_%Y")
2 + currentTime=$(date +"%T")
3 +
4 + echo "Hello! It is $currentTime on the $currentDate" >> my-log.log
Newer Older