[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get the current time in time zone represented by strings like
From: |
Grisha Levit |
Subject: |
Re: How to get the current time in time zone represented by strings like +0100? |
Date: |
Wed, 15 May 2024 01:04:14 -0400 |
On Tue, May 14 2024 at 16:05 Peng Yu wrote:
> For example, in the time zone represented by +0100, how to get its
> current time from date using '+0100' as input? Thanks.
Use the offset to create a timezone specification, supplied in the TZ
environment variable.
TZ='XXX-01:00' date
The `XXX` is an arbitrary (required) name. Note that the sign of the
offset has the opposite of its usual meaning. The full format can be
found in the tzset(3) man page.