snafu has asked for the wisdom of the Perl Monks concerning the following question:
Such conversions do not seem to work on my Sun system using Perl's POSIX::strftime function *or* the system date. Therefore, I tried it on my FreeBSD box and things are just as up in the air as with the Sun box only the system seems to work properly there (which doesn't surprise me...Sun, grrr)
The POSIX::strftime perldoc is not very helpful in this respect unless I am missing something (which I admit is entirely possible)
[notjames@zap ~]$ date +%EG 2002 [notjames@zap ~]$ date +%Eg 02 [notjames@zap ~]$ perl -MPOSIX -e 'print strftime('%Eg',localtime())," +\n"' 43 [notjames@zap ~]$ perl -MPOSIX -e 'print strftime('%Eg',localtime())," +\n";' 58 [notjames@zap ~]$ perl -MPOSIX -e 'print strftime('%Eg',localtime())," +\n";' 0 [notjames@zap ~]$ perl -MPOSIX -e 'print strftime('%Eg',localtime())," +\n";' 2 [notjames@zap ~]$ perl -MPOSIX -e 'print strftime('%Eg',localtime())," +\n";' 4 [notjames@zap ~]$ perl -MPOSIX -e 'print strftime('%g',localtime()),"\ +n";' 9 [notjames@zap ~]$ perl -MPOSIX -e 'print strftime('%G',localtime()),"\ +n";' 16 [notjames@zap ~]$
The Sol box did less! (surprise surprise)...
This very well maybe be a system issue vs a Perl issue. It could be how Perl was built. I'd just like to clarify which it might be. Has anyone else ever run into this?$ date +%Eg %Eg $ date + %Eg $ date + %C $ date +%C Tue Aug 20 16:46:32 EDT 2002 $ date +%Og %Og $ perl -MPOSIX -e 'print strftime("%Og",localtime()),"\n";' %Og $ perl -MPOSIX -e 'print strftime("%Eg",localtime()),"\n";' %Eg $ perl -MPOSIX -e 'print strftime("%Eg",localtime()),"\n";' %Eg
_
_
_
_
_
_
_
_
_
_
- Jim
Insert clever comment here...
|
|---|