Man page - timedatectl(1)
Packages contains this manual
- systemd-initctl.service(8)
- systemd-networkd.service(8)
- org.freedesktop.locale1(5)
- timedatectl(1)
- systemd.resource-control(5)
- systemd.journal-fields(7)
- systemd-logind.service(8)
- busctl(1)
- systemd-pstore(8)
- systemd.generator(7)
- hostname(5)
- systemd-path(1)
- systemd-random-seed.service(8)
- locale.conf(5)
- systemd-firstboot(1)
- systemd-sysv-generator(8)
- systemd.syntax(7)
- loginctl(1)
- tmpfiles.d(5)
- org.freedesktop.portable1(5)
- systemd-timedated(8)
- systemd-pstore.service(8)
- systemd-escape(1)
- systemd-system-update-generator(8)
- systemd-backlight@.service(8)
- systemd-udev-settle.service(8)
- systemd.directives(7)
- systemd.index(7)
- systemd.environment-generator(7)
- systemd-network-generator.service(8)
- org.freedesktop.systemd1(5)
- systemd-user-sessions.service(8)
- systemd-pcrlock(8)
- systemd-journald.socket(8)
- systemd-user-runtime-dir(5)
- systemd-logind(8)
- systemd-initctl.socket(8)
- systemd-pcrlock-make-policy.service(8)
- systemd(1)
- systemd-inhibit(1)
- networkctl(1)
- systemd-random-seed(8)
- sysusers.d(5)
- systemd-boot-check-no-failures(8)
- systemd.v(7)
- systemd-creds(1)
- systemd-networkd(8)
- systemd-makefs(8)
- systemd-fsck(8)
- systemd-localed.service(8)
- journald.conf.d(5)
- systemd-pcrfs@.service(8)
- systemd-cat(1)
- systemd-id128(1)
- user@.service(5)
- systemd.unit(5)
- systemd.net-naming-scheme(7)
- systemd-volatile-root(8)
- org.freedesktop.machine1(5)
- systemd-firstboot.service(1)
- localtime(5)
- systemd-timedated.service(8)
- systemd-ask-password-console.path(8)
- varlinkctl(1)
- org.freedesktop.timedate1(5)
- systemd-run-generator(8)
- systemd-system.conf(5)
- systemd-journald-varlink@.socket(8)
- systemd-rfkill.socket(8)
- systemd.exec(5)
- systemd-journald@.socket(8)
- systemd-shutdown(8)
- systemd-fsck-usr.service(8)
- systemd-sysctl.service(8)
- systemd-pcrphase.service(8)
- systemd-localed(8)
- systemd-journald(8)
- systemd-ssh-proxy(1)
- systemd.offline-updates(7)
- systemd-pcrlock-secureboot-authority.service(8)
- systemd-ac-power(1)
- pam_systemd_loadkey(8)
- systemd.device(5)
- systemd-quotacheck.service(8)
- systemd-machine-id-commit.service(8)
- systemd-backlight(8)
- binfmt.d(5)
- systemd-getty-generator(8)
- networkd.conf.d(5)
- systemd.path(5)
- systemd-networkd-wait-online.service(8)
- system.conf.d(5)
- systemd-detect-virt(1)
- systemd-sleep.conf(5)
- sysctl.d(5)
- systemd-vpick(1)
- systemd-pcrlock-secureboot-policy.service(8)
- systemd-update-done(8)
- systemd-sysctl(8)
- pstore.conf.d(5)
- hostnamectl(1)
- systemd-confext(8)
- logind.conf.d(5)
- capsule@.service(5)
- systemd-poweroff.service(8)
- systemd-modules-load(8)
- systemd.special(7)
- org.freedesktop.network1(5)
- systemd.pcrlock.d(5)
- systemd-kexec.service(8)
- systemd-stdio-bridge(1)
- systemd-umount(1)
- systemd-quotacheck(8)
- systemd-sysext.service(8)
- systemd-notify(1)
- systemd-suspend-then-hibernate.service(8)
- systemd-growfs(8)
- systemctl(1)
- systemd-hibernate-clear.service(8)
- systemd-run(1)
- systemd-pcrlock-firmware-code.service(8)
- systemd-sysusers.service(8)
- environment.d(5)
- systemd-networkd-wait-online(8)
- systemd-initctl(8)
- systemd-remount-fs.service(8)
- systemd.network(5)
- systemd-journald@.service(8)
- systemd-pcrlock-file-system.service(8)
- systemd-hibernate-resume.service(8)
- systemd-tty-ask-password-agent(1)
- systemd-growfs@.service(8)
- systemd-ask-password(1)
- systemd-hibernate-resume-generator(8)
- systemd-sleep(8)
- systemd.image-policy(7)
- systemd-hibernate.service(8)
- systemd.timer(5)
- systemd-boot-check-no-failures.service(8)
- networkd.conf(5)
- systemd-tpm2-setup(8)
- systemd-pcrphase-initrd.service(8)
- systemd-xdg-autostart-generator(8)
- systemd-tmpfiles-setup-dev-early.service(8)
- systemd-binfmt(8)
- systemd-user-sessions(8)
- file-hierarchy(7)
- systemd-socket-proxyd(8)
- localectl(1)
- modules-load.d(5)
- machine-id(5)
- systemd-battery-check.service(8)
- systemd-update-done.service(8)
- systemd.mount(5)
- systemd-machine-id-setup(1)
- systemd-storagetm.service(8)
- systemd-growfs-root.service(8)
- systemd.swap(5)
- systemd-hibernate-resume(8)
- initrd-release(5)
- systemd.target(5)
- sleep.conf.d(5)
- systemd-mkswap@.service(8)
- journald@.conf(5)
- systemd-reboot.service(8)
- systemd-journald.service(8)
- systemd-socket-activate(1)
- systemd-tmpfiles-clean.timer(8)
- systemd-debug-generator(8)
- systemd-cgtop(1)
- systemd-measure(1)
- systemd.service(5)
- systemd.slice(5)
- systemd-remount-fs(8)
- systemd-ssh-generator(8)
- systemd-bsod(8)
- systemd-pcrlock-firmware-config.service(8)
- systemd-bsod.service(8)
- systemd-pcrmachine.service(8)
- logind.conf(5)
- bootup(7)
- kernel-install(8)
- systemd-networkd-wait-online@.service(8)
- systemd-network-generator(8)
- kernel-command-line(7)
- pstore.conf(5)
- rc-local.service(8)
- systemd-confext.service(8)
- systemd-soft-reboot.service(8)
- systemd.system-credentials(7)
- systemd-fstab-generator(8)
- systemd-tpm2-setup-early.service(8)
- systemd-tmpfiles(8)
- systemd.preset(5)
- run0(1)
- user.conf.d(5)
- systemd-pcrlock-machine-id.service(8)
- os-release(5)
- systemd-fsck-root.service(8)
- systemd-battery-check(8)
- systemd.automount(5)
- systemd-pcrfs-root.service(8)
- systemd.kill(5)
- systemd-pcrphase-sysinit.service(8)
- journalctl(1)
- 30-systemd-environment-d-generator(8)
- systemd.socket(5)
- systemd-rc-local-generator(8)
- systemd-sysext(8)
- systemd-fsck@.service(8)
- systemd.time(7)
- systemd-rfkill(8)
- systemd-ask-password-wall.path(8)
- machine-info(5)
- systemd-tpm2-generator(8)
- systemd-binfmt.service(8)
- org.freedesktop.login1(5)
- systemd-delta(1)
- systemd-tmpfiles-clean.service(8)
- systemd-ask-password-wall.service(8)
- user-runtime-dir@.service(5)
- systemd-cgls(1)
- smbios-type-11(7)
- systemd-ask-password-console.service(8)
- systemd.netdev(5)
- systemd-journald-dev-log.socket(8)
- systemd-storagetm(8)
- systemd-journald-audit.socket(8)
- systemd-tmpfiles-setup-dev.service(8)
- systemd-hybrid-sleep.service(8)
- systemd-analyze(1)
- systemd-environment-d-generator(8)
- systemd-hostnamed(8)
- systemd-hostnamed.service(8)
- systemd-pcrextend(8)
- systemd-tmpfiles-setup.service(8)
- systemd.pcrlock(5)
- systemd-tpm2-setup.service(8)
- systemd-suspend.service(8)
- systemd-mount(1)
- org.freedesktop.hostname1(5)
- extension-release(5)
- systemd-makefs@.service(8)
- iocost.conf(5)
- systemd-gpt-auto-generator(8)
- systemd-halt.service(8)
- systemd-modules-load.service(8)
- systemd-sysusers(8)
- systemd-user.conf(5)
- systemd-rfkill.service(8)
- systemd-volatile-root.service(8)
- systemd.scope(5)
- daemon(7)
- journald.conf(5)
apt-get install systemd
Available languages:
en zh_TW zh_CN deManual
TIMEDATECTL
NAMESYNOPSIS
描 述
选 项
退 出 状 态
环 境 变 量
例 子
参 见
跋
NAME
timedatectl - 控 制 系 统 的 时 间 与 日 期
SYNOPSIS
|
timedatectl [OPTIONS...] {COMMAND} |
描 述
timedatectl 可 用 于 查 询 与 修 改 系 统 时 钟 的 各 项 设 置 。
可 以 使 用 systemd-firstboot (1) 初 始 化 已 挂 载 (但 未 启 动 )的 系 统 镜 像 的 时 区 设 置 。
选 项
能 够 识 别 的 命 令 行 选 项 如 下 :
--no-ask-password
在 执 行 特 权 操 作 时 不 向 用 户 索 要 密 码 。
--adjust-system-clock
当 使 用 set-local-rtc 命 令 时 , 若 使 用 了 此 选 项 , 则 表 示 根 据 RTC时 间 来 更 新 系 统 时 钟 。 若 未 使 用 此 选 项 , 则 表 示 根 据 系 统 时 钟 来 更 新 RTC时 间 。
-H , --host=
操 作 指 定 的 远 程 主 机 。 可 以 仅 指 定 一 个 主 机 名 (hostname), 也 可 以 使 用 "username@hostname" 格 式 。 hostname 后 面 还 可 以 加 上 容 器 名 (以 冒 号 分 隔 ), 也 就 是 形 如 "hostname:container" 的 格 式 , 以 表 示 直 接 连 接 到 指 定 主 机 的 指 定 容 器 内 。 操 作 将 通 过 SSH协 议 进 行 , 以 确 保 安 全 。 可 以 通 过 machinectl -H HOST 命 令 列 出 远 程 主 机 上 的 所 有 容 器 名 称 。
-M , --machine=
在 本 地 容 器 内 执 行 操 作 。 必 须 明 确 指 定 容 器 的 名 称 。
-h , --help
显 示 简 短 的 帮 助 信 息 并 退 出 。
--version
显 示 简 短 的 版 本 信 息 并 退 出 。
--no-pager
不 将 程 序 的 输 出 内 容 管 道 (pipe)给 分 页 程 序 。
能 够 识 别 的 命 令 如 下 :
status
显 示 系 统 时 钟 与 RTC的 当 前 状 态 , 包 括 时 区 设 置 与 网 络 时 间 同 步 服 务 的 状 态 。 注 意 , 所 谓 "网 络 时 间 同 步 服 务 的 状 态 "实 际 上 只 是 systemd-timesyncd.service 服 务 的 状 态 , 并 不 检 查 是 否 存 在 其 他 时 间 同 步 服 务 。 这 是 默 认 命 令 。
set-time [TIME]
将 系 统 时 钟 设 为 指 定 的 时 间 , 并 同 时 更 新 RTC时 间 。 [TIME] 是 一 个 形 如 "2012-10-30 18:17:16"的 时 间 字 符 串 。
set-timezone [TIMEZONE]
设 置 系 统 时 区 , 也 就 是 更 新 /etc/localtime 软 连 接 的 指 向 。 可 以 用 下 面 的 list-timezones 命 令 列 出 所 有 可 用 时 区 。 如 果 RTC被 设 为 本 地 时 间 , 此 命 令 还 会 同 时 更 新 RTC时 间 。 详 见 localtime (5) 手 册 。
list-timezones
列 出 所 有 可 用 时 区 , 每 行 一 个 。 列 出 的 值 可 以 用 作 前 述 set-timezone 命 令 的 参 数 。
set-local-rtc [BOOL]
设 为 "no" 表 示 在 RTC中 存 储 UTC时 间 ; 设 为 "yes" 表 示 在 RTC中 存 储 本 地 时 间 。 应 该 尽 一 切 可 能 在 RTC中 存 储 UTC时 间 。 尽 量 不 要 在 RTC中 存 储 本 地 时 间 , 因 为 这 会 造 成 一 系 列 麻 烦 , 尤 其 是 在 切 换 时 区 以 及 调 整 夏 令 时 或 冬 令 时 的 时 候 。 注 意 , 除 非 明 确 使 用 了 --adjust-system-clock 选 项 , 否 则 此 命 令 还 会 同 时 用 系 统 时 钟 更 新 RTC时 间 。 此 命 令 还 会 改 变 /etc/adjtime 文 件 第 三 行 的 内 容 , 详 见 hwclock (8) 手 册 。
set-ntp [BOOL]
是 否 开 启 网 络 时 间 同 步 。 设 为 "yes" 则 启 用 并 启 动 systemd-timesyncd.service 服 务 , 设 为 "no" 则 停 止 并 停 用 它 。 该 命 令 除 了 控 制 systemd-timesyncd.service 服 务 的 状 态 , 不 做 任 何 其 他 操 作 。 也 就 是 说 , 设 为 "yes" 相 当 于 执 行 systemctl enable --now systemd-timesyncd.service 命 令 ; 而 设 为 "no" 则 相 当 于 执 行 systemctl disable --now systemd-timesyncd.service 命 令 ;
注 意 , 即 使 使 用 此 命 令 关 闭 了 systemd-timesyncd.service 服 务 , 仍 然 有 可 能 存 在 其 他 时 间 同 步 服 务 。 另 外 , 严 格 来 说 , systemd-timesyncd.service 除 了 同 步 时 间 之 外 , 还 同 时 兼 有 其 他 功 能 , 例 如 在 无 网 络 且 无 RTC的 系 统 上 维 持 系 统 的 "单 调 时 钟 "。 详 见 systemd-timesyncd.service (8) 手 册 。
退 出 状 态
返 回 值 为 0 表 示 成 功 , 非 零 返 回 值 表 示 失 败 代 码 。
环 境 变 量
$SYSTEMD_PAGER
指 定 分 页 程 序 。 仅 在 未 指 定 --no-pager 选 项 时 有 意 义 。 此 变 量 会 覆 盖 $PAGER 的 值 。 将 此 变 量 设 为 空 字 符 串 或 "cat" 等 价 于 使 用 --no-pager 选 项 。
$SYSTEMD_LESS
用 于 覆 盖 默 认 传 递 给 less 程 序 的 命 令 行 选 项 ("FRSXMK")。
例 子
显 示 当 前 的 时 间 设 置
$ timedatectl
Local time: Di 2015-04-07 16:26:56 CEST
Universal time: Di 2015-04-07 14:26:56 UTC
RTC time: Di 2015-04-07 14:26:56
Time zone: Europe/Berlin (CEST, +0200)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no
开 启 网 络 时 间 同 步 服 务
$ timedatectl
set-ntp true
==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp
===
Authentication is required to control whether network time
synchronization shall be enabled.
Authenticating as: user
Password: ********
==== AUTHENTICATION COMPLETE ===
$ systemctl
status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time
Synchronization
Loaded: loaded
(/usr/lib/systemd/system/systemd-timesyncd.service; enabled)
Active: active (running) since Mo 2015-03-30 14:20:38 CEST;
5s ago
Docs: man:systemd-timesyncd.service(8)
Main PID: 595 (systemd-timesyn)
Status: "Using Time Server 216.239.38.15:123
(time4.google.com)."
CGroup: /system.slice/systemd-timesyncd.service
└─595 /usr/lib/systemd/systemd-timesyncd
...
参 见
systemd (1), hwclock (8), date (1), localtime (5), systemctl (1), systemd-timedated.service (8), systemd-timesyncd.service (8), systemd-firstboot (1)
跋
本 页 面 中 文 版 由 中 文 man 手 册 页 计 划 提 供 。
翻
译 人 员 : 金 步
国
金 步 国 作 品 集
: http://www.jinbuguo.com
中 文 man 手 册 页 计
划 :
https://github.com/man-pages-zh/manpages-zh