Let's Bash, Technical Getting a Date in Bash Posted by Shabana Mukhtar on October 23, 2022 You can use the date command to get the current date. Example To get the date in YYYY-mm-dd HH:MM:SS format: datetime=$(date '+%Y-%m-%d %H:%M:%S') Output 2022-10-10 11:30:30 Until next time… Shabana Mukhtar