SysTutorials Forums QA How to get date and time using date command from another timezone in Linux?

Tagged: ,

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?

You can make date print the time of another timezone by setting the TZ environment variable.

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/

ENVIRONMENT

TZ
Specifies the timezone, unless overridden by command line parameters. If neither is specified, the setting from /etc/localtime is used.

Reply To: How to get date and time using date command from another timezone in Linux?
Your information:





<a href="" title="" rel="" target=""> <blockquote cite=""> <code> <pre> <em> <strong> <del datetime=""> <ul> <ol start=""> <li> <img src="" border="" alt="" height="" width="">

Cancel
Please share if you like this post: