[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] POSIX::strftime



Solved my own problem:) Many thanks to those who suggested using
localtime() or various scripts for processing the 'time' function itself.
The reason I wanted strftime()  is that it understands internationalized
machines (at least Unix ones). So if I say: 

   use POSIX qw(strftime);
   print strftime("%A",localtime);

the result will be the day-name in whatever language the machine is
configured for. In addition, the formatting itself is very flexible.

I had writen the script or a machine that apparently had an enhanced set
of formatting specs. Best as I can determine, the Mac version has the
single entities but not the combined ones--"%m/%d/%y" will give the date,
but "%D" (which on some systems is shorthand for "%m/%d/%y") will be
unreliable. 

The CPAN Date::Format module gives many runtime errors.

I had said:
>I've been using the POSIX::strftime() function to output human-readable
>dates under unix perl5. When I moved to MacPerl, however, the format
>strings seem to have changed. Does anyone know the specs for the Mac
>version and/or know of a platform-independent way to format time/date?


-- 
Daniel Macks
dmacks@netspace.org
http://www.netspace.org/~dmacks