[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: bug report with strftime on win2000
From: |
Aharon Robbins |
Subject: |
RE: bug report with strftime on win2000 |
Date: |
Tue, 31 Dec 2002 15:49:12 +0200 |
I beg your pardon? The results I showed are what I just got, on my
GNU/Linux system. I have LC_ALL="C" in my environment; I begin to suspect
locale-related issues.
Let's bypass gawk. Redhat 8.0 GNU/Linux; here's some C code:
#include <stdio.h>
#include <time.h>
int main(void)
{
char buf[100];
time_t now;
struct tm *t;
(void) time(& now);
t = localtime(& now);
strftime(buf, sizeof buf, "%g%m%d", t);
printf("%s\n", buf);
}
Upon compiling and running it:
$ cc foo.c
$ a.out
031231
If there's a bug, I don't know what it is, but it's not in gawk, it's
in the underlying C strftime function.
I hope this helps.
Arnold
> From: "Marko Lesar" <address@hidden>
> To: "Aharon Robbins" <address@hidden>
> Subject: RE: bug report with strftime on win2000
> Date: Tue, 31 Dec 2002 14:30:48 +0100
>
> Greetings too. And it's not 031231, even under Linux.
>
> Marko
>
> -----Original Message-----
> From: Aharon Robbins [mailto:address@hidden
> Sent: Tuesday, December 31, 2002 2:26 PM
> To: address@hidden; address@hidden
> Subject: Re: bug report with strftime on win2000
>
> Greetings. Re this:
>
> > From: "Marko Lesar" <address@hidden>
> > To: <address@hidden>, <address@hidden>
> > Cc: <address@hidden>
> > Subject: bug report with strftime on win2000
> > Date: Tue, 31 Dec 2002 09:07:43 +0100
> >
> > Bugreport:
> >
> > Versions:
> >
> > gawk -W version
> > GNU Awk 3.0.4
> > Copyright (C) 1989, 1991-1999 Free Software Foundation.
>
> This version is severely out of date. The current version is
> 3.1.1. Under Linux, I get:
>
> $ date
> Tue Dec 31 15:24:11 IST 2002
> $ gawk 'BEGIN { print strftime("%g%m%d",systime()) }'
> 031231
>
> The C strftime in this version of gawk is orignally from GNU libc,
> and I believe the code is correct.
>
> Arnold
>
>
>