Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Oct 2000 14:00:57 -0700 (PDT)
From:      ian@mahuron.org
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/22279: stock perl5 build does not support %Z spec in strftime
Message-ID:  <20001024210057.DD13737B479@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         22279
>Category:       bin
>Synopsis:       stock perl5 build does not support %Z spec in strftime
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 24 14:10:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Ian Mahuron
>Release:        4.0
>Organization:
>Environment:
FreeBSD dev01.xxx.com 4.0-RELEASE FreeBSD 4.0-RELEASE #0: Thu Sep 21 14:20:32 PDT 2000     ian@dev01.xxx.com:/usr/src/sys/compile/DEV01  i386
>Description:
Perl's POSIX module is a wrapper for common POSIX routines... one of the functions in this module is strftime.

It works as expected, unless you make use of the %Z spec (returns ???).
Making use of strftime via a c program results in correct behavior (returns PDT).
>How-To-Repeat:
Perl script:
perl -MPOSIX -e 'print(strftime("%Z", (localtime)), "\n");'
# prints "???"

C script:
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
int main(void) {
        char buff[4];
        time_t now = time(NULL);
        strftime(buff, sizeof(buff), "%Z", localtime(&now) );
        printf("%s\n", buff);
        return;
}
// prints 'PDT'
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001024210057.DD13737B479>