in reply to POSIX strftime format question

Yeah, strftime won't handle that.

It's simple enough to fix it using Lingua::EN::Number::Ordinate tho'.

#!/usr/bin/perl use strict; use warnings; use POSIX 'strftime'; use Lingua::EN::Numbers::Ordinate; my $date = strftime '%B %d, %Y', localtime; $date =~ s/(\d+)/ordinate($1)/e; print "$date\n"
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re^2: POSIX strftime format question
by geektron (Curate) on Oct 22, 2004 at 10:25 UTC
    hrm ... install a new module ( which may come in handy ) or roll 'myself' (meaning steal someone else's rolling)?

    either way, it's not something POSIX does ... which i just needed confirmation on.

    thanks.

Re^2: POSIX strftime format question
by geektron (Curate) on Oct 22, 2004 at 10:29 UTC
    FYI -- typo in one place ...

    it's "Lingua::EN::Numbers::Ordinate", which you have right in the code snip but wrong in the 'use' part of the note ..