* Philip Newton ([EMAIL PROTECTED]) [13 Aug 2000 04:10]:
> On Fri, 11 Aug 2000, Nathan Wiger wrote:
> > Philip Newton wrote:
> > > So if we're now on 1-indexing, we'll see lots of @months = (undef, 'Jan',
> > > 'Feb') or qw(dummy Jan Feb)... oh well.
> > 
> > Far better, use the new builtin object methods:
> > 
> >    $d = date;
> >    print "today is ", $d->date('%A');  # Friday

> This doesn't solve the problem for those who want 'F', or 'Fri', or
> even 'Freitag' or 'Vendredi'.

Well, Fri can be catered for using %a (as in strftime at present). Check
out 'man strftime':

%a     The abbreviated weekday name according to the current locale.
%A     The full weekday name according to the current locale.
%b     The abbreviated month name according to the current locale.
%B     The full month name according to the current locale.
%c     The preferred date and time representation for the current locale.

Note the 'current locale' bit. That takes care of Freitag, Vendredi or
Kinyoobi (in UTF-16, natch).

As for F? Use substr.


cheers,
-- 
iain truskett, aka Koschei.                    <http://eh.org/~koschei/>
      Strings selected at random are much more likely to be
      syntactically correct Perl programs than they are to be C or Lisp
      programs, and in fact have positive probability of being correct.
               -- <http://www.plover.com/~mjd/perl/idiocy/RandProg.html>

Reply via email to