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.