Bug 22279

Summary: stock perl5 build does not support %Z spec in strftime
Product: Base System Reporter: ian <ian>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description ian 2000-10-24 22:10:01 UTC
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'
Comment 1 Jens Schweikhardt freebsd_committer freebsd_triage 2001-06-14 11:28:31 UTC
State Changed
From-To: open->closed

Fixed in -current (which uses perl 5.6.0).