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

Tagged: ,

Viewing 1 reply thread

    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.

Viewing 1 reply thread
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 class=""> <em> <strong> <del datetime="" cite=""> <ins datetime="" cite=""> <ul> <ol start=""> <li> <img src="" border="" alt="" height="" width="">

Please share if you like this post: