bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] Gawk manual: 9.1.5 Time Functions, strftime([format [, ti


From: Aharon Robbins
Subject: Re: [bug-gawk] Gawk manual: 9.1.5 Time Functions, strftime([format [, timestamp [, utc-flag]]])
Date: Sun, 03 Feb 2013 20:21:51 +0200
User-agent: Heirloom mailx 12.5 6/20/10

Hi Hermann.

Andy's answer is correct. The idea is that with no arguments strftime()
defaults to the value of PROCINFO["strftime"] and the current time of day,
but if you have a specific timestamp, you need to also supply a format
value.

However, having it available from PROCINFO["stftime"] lets you not have
to remember (or look up) the values for the format string, you can just
do

        timestamp = ... # get from whatever
        print strftime(PROCINFO["strftime"], timestamp)

Thanks,

Arnold



reply via email to

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