| Summary: | stock perl5 build does not support %Z spec in strftime | ||
|---|---|---|---|
| Product: | Base System | Reporter: | ian <ian> |
| Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
State Changed From-To: open->closed Fixed in -current (which uses perl 5.6.0). |
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'