[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: time zone for strftime
From: |
david kerns |
Subject: |
Re: time zone for strftime |
Date: |
Wed, 21 Jul 2021 18:50:30 -0700 |
it uses the standard environment variable TZ. An example on the same link
you sent shows it
being used in conjunction w/ strftime.
On Wed, Jul 21, 2021 at 6:45 PM Bob Proulx <bob@proulx.com> wrote:
> Peng Yu wrote:
> > https://www.gnu.org/software/gawk/manual/html_node/Time-Functions.html
> >
> > I don't see a way to specify a time zone for strftime when converting
> > an epoch time to the time zone time. Is there a way to do it? Thanks.
>
> The manual says this:
>
> 'strftime('[FORMAT [',' TIMESTAMP [',' UTC-FLAG] ] ]')'
> Format the time specified by TIMESTAMP based on the contents of
> the
> FORMAT string and return the result. It is similar to the
> function
> of the same name in ISO C. If UTC-FLAG is present and is either
> nonzero or non-null, the value is formatted as UTC (Coordinated
> Universal Time, formerly GMT or Greenwich Mean Time). Otherwise,
> the value is formatted for the local time zone. The TIMESTAMP is
> in the same format as the value returned by the 'systime()'
> function. If no TIMESTAMP argument is supplied, 'gawk' uses the
> current time of day as the timestamp. Without a FORMAT argument,
> 'strftime()' uses the value of 'PROCINFO["strftime"]' as the
> format
> string (*note Built-in Variables::). The default string value is
> '"%a %b %e %H:%M:%S %Z %Y"'. This format string produces output
> that is equivalent to that of the 'date' utility. You can assign
> a
> new value to 'PROCINFO["strftime"]' to change the default format;
> see the following list for the various format directives.
>
>