Linux: change date and time


Change Date:

[root@tutorialspots ~]# date +%Y%m%d -s "20220526"
20220526
[root@tutorialspots ~]# date
Thu May 26 00:00:03 +07 2022

Change Time:

[root@tutorialspots ~]# date +%T -s "11:10:22"
11:10:22
[root@tutorialspots ~]# date
Thu May 26 11:10:23 +07 2022

Change Timezone:

[root@tutorialspots ~]# sudo timedatectl set-timezone Asia/Bangkok

Leave a Reply