linux date 时区
date
command on Linux gets the date and time in the system timezone. But how to get date and time using date command from another timezone in Linux?
Linux上的date
命令获取系统时区中的日期和时间。 但是如何从Linux的另一个时区使用date命令获取日期和时间呢?
You can make date
print the time of another timezone by setting the TZ
environment variable.
您可以通过设置TZ
环境变量来使date
打印另一个时区的时间。
For example,
例如,
export TZ=Hongkong; date
Sat Dec 1 09:39:13 HKT 2018
From the manual of date
https://www.systutorials.com/docs/linux/man/1-date/
从date
手册https ://://www.systutorials.com/docs/linux/man/1-date/
ENVIRONMENT
环境
TZ
Specifies the timezone, unless overridden by command line parameters. If neither is specified, the setting from /etc/localtime is used.
TZ
指定时区,除非被命令行参数覆盖。 如果未指定,则使用/ etc / localtime中的设置。
linux date 时区