GAWK: strftime("%z") and portability (which version of strftime is used in compile?) 
Author Message
 GAWK: strftime("%z") and portability (which version of strftime is used in compile?)

I just noticed that in Linux, strftime("%z") works (gives me a usable
offset between local time and GMT), but under Solaris it doesn't (just
returns %z).  This is tested with latest (3.1) vrsns of GAWK.

One thing I've noticed is that when GAWK is ./configure'd, it seems to try
to use the local strftime if it is available, else it uses its own (this is
also per "Effective AWK Programming".  This seems like a bad idea.
According to "Effective AWK Programming", the "public domain version of
strftime" is better anyway (supports more options).  Wouldn't it be better
to just always use that?

Is there an option I can give to the configure script to make it make "%z"
work (under Solaris)?



Thu, 18 Dec 2003 01:03:36 GMT  
 GAWK: strftime("%z") and portability (which version of strftime is used in compile?)

Quote:

>I just noticed that in Linux, strftime("%z") works (gives me a usable
>offset between local time and GMT), but under Solaris it doesn't (just
>returns %z).  This is tested with latest (3.1) vrsns of GAWK.

>One thing I've noticed is that when GAWK is ./configure'd, it seems to try
>to use the local strftime if it is available, else it uses its own (this is
>also per "Effective AWK Programming".  This seems like a bad idea.
>According to "Effective AWK Programming", the "public domain version of
>strftime" is better anyway (supports more options).  Wouldn't it be better
>to just always use that?

>Is there an option I can give to the configure script to make it make "%z"
>work (under Solaris)?

Followup to this: Through brute force hacking of the config.h file (and
also missing_d/strftime.h), I was able to get it to compile and recognize
%z, under Solaris.  However, it doesn't do Daylight Savings Time - that is,
for Chicago, it reports -0600 (Note that GNU date does the right thing - it
reports -0500 currently for Chicago).

Note to Arnold Robbins, et al:  I know that the GAWK documentation says not
to report bugs by posting to comp.lang.awk.  However:

        1) This isn't really a bug report
        2) I find the submission processes detailed in the documentation
           too tedious and unreliable - and, as far as I can tell, you have
           already read what I have written here and responded to it.  For
           that, I thank you.



Thu, 18 Dec 2003 02:54:27 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Localized strftime() output

2. unix time and strftime

3. strftime * date calculations

4. Q: inverse of strftime

5. "Portability in Ada" by Peter Wallis

6. strftime weirdness

7. strftime year

8. time.strftime BUG?

9. strftime: %Z, timezone, and all that

10. strftime ?

11. strftime and windows

12. bug in time.strftime on linux???

 

 
Powered by phpBB® Forum Software