- How to set time on Linux Server
- How to sync NTP time with chrony
- How to sync NTP time with systemd-timesyncd
- ntpdate
- Set server time PST/PDT
- Determine the Default Time Zone on Linux
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
Leave a Reply