linux date 时区_如何从Linux的另一个时区使用date命令获取日期和时间?

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中的设置。

翻译自: https://www.systutorials.com/how-to-get-date-and-time-using-date-command-from-another-timezone-in-linux-2/

linux date 时区

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值