sudo timedatectl set-timezone Asia/Tehran
sudo ln -sf /usr/share/zoneinfo/Asia/Tehran /etc/localtime
sudo hwclock --systohc
- Alpine 👌 ⏰ ✔️
# apk add --no-cache tzdata
# ls /usr/share/zoneinfo
# cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime
# echo "Asia/Tehran" > /etc/timezone
### You can now remove the other timezones
# apk del tzdataبرای سینک کردن تایم بعد از اسلیپ خارج شدن کامپیوتر باید این دستورات را اجرا کنید که اتوماتیک تایم سینک شود install virtualbox
apk add virtualbox-guest-additionsrun cmd
/usr/sbin/VBoxService --timesync-set-start- ubuntu 👌 ⏰✔️
# cat /etc/timezone
# timedatectl list-timezones
# timedatectl set-timezone your_time_zone -> for exam Asia/Tehran
# timedatectldate +%Y%m%d -s "20150422"date +%T -s "11:14:00"date -s "19 APR 2012 11:14:00"
or
date -s "2013-11-19 15:11:40"datedate +%Zdate --utc
Sat Sep 5 07:57:50 UTC 2015I always keep my hardware clocks set to UTC/GMT. This maintains my clocks uniformly without any worries about "Daylight Savings Time". This is important, because when you set the hardware clock from the system clock (kept by the Linux kernel), you need to know if this is the case. To set the hardware clock from the system clock, leaving the hardware clock in UTC, enter the following:
hwclock --systohc --utcrm /etc/localtime
ln -s /usr/share/zoneinfo/Iran /etc/localtimefor check
ls -al|grep localtime
lrwxrwxrwx 1 root root 24 Apr 22 10:02 localtime -> /usr/share/zoneinfo/iranSetting the system time using the date command does not automatically synchronize the RTCs. Use the hwclock command after entering the date command to synchronize an RTC with the updated system time:
hwclock -wUpdate from the command line against a time server You can update the clock manually, without the need of the daemon with ntpdate
ntpdate 129.6.15.28Using the date and hwclock Command Use these two commands to manipulate the system clock and hardware clock directly. From http://busybox.net/downloads/BusyBox.html#hwclock .
hwclock -r
(Show hardware clock time)
hwclock -w
(Set hardware clock to system time)
hwclock -s
(Set system time from hardware clock)
-f FILE can be used to specify a particular RTC device (e.g. /dev/rtc2).