coreutils
[Top][All Lists]
Advanced

[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: Peng Yu
Subject: Re: How to get the current time in time zone represented by strings like +0100?
Date: Thu, 16 May 2024 08:24:21 -0500

On Wed, May 15, 2024 at 12:04 AM Grisha Levit <grishalevit@gmail.com> wrote:
>
> 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

Strings like +0100 is relative to UTC. For example, +0100 is Central
European Time. I guess that you understood +0100 as relative to my
current timezone.

How to achieve +0100 as relative to UTC with 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.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]