time

Timestamp in Bash Script

TIME_STAMP="$(date +%Y%m%d-%H%M%S)"

for timestamp like 2020-01-23 15:12:45, use

TIME_STAMP="$(date "+%Y-%m-%d %H:%M:%S")"

For file name

date +"%Y-%m-%d-%H-%M-%S"

Time stamp in PHP

$now = date("Y-m-d-h:i:s");

Taking backup

mysqldump -u root -p'mv9wCAcDE3CnBV' serverok_wp > ~/serverok_wp-`date +"%Y-%m-%d-%H-%M-%S"`.sql

Alaram/stopwatch

Time Tracking

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *