geektron has asked for the wisdom of the Perl Monks concerning the following question:
with something that doesn't call the database. it seems a bit silly that this code is:my $sth=$dbh->prepare( "SELECT DATE_FORMAT(NOW(), '%M %D, %Y')"); my $rv=$sth->execute; my ($date) = $sth->fetchrow_array; $sth->finish;
the database query returns: October 22nd, 2004
what i thought would be the equiv. POSIX compliant format
returns: October 22, 2004use POSIX qw( strftime ); my $date = strftime "%B %d, %Y", localtime;
can i accomplish the 'suffixing' of the ordinal with the POSIX formats, or should I just handle the date outside of the loop?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: POSIX strftime format question
by davorg (Chancellor) on Oct 22, 2004 at 10:09 UTC | |
by geektron (Curate) on Oct 22, 2004 at 10:29 UTC | |
by geektron (Curate) on Oct 22, 2004 at 10:25 UTC | |
|
Re: POSIX strftime format question
by BUU (Prior) on Oct 22, 2004 at 10:19 UTC | |
by bart (Canon) on Oct 22, 2004 at 10:53 UTC | |
by Anonymous Monk on Oct 22, 2004 at 16:49 UTC | |
|
Re: POSIX strftime format question
by bobf (Monsignor) on Oct 22, 2004 at 16:03 UTC | |
|
Re: POSIX strftime format question
by YuckFoo (Abbot) on Oct 22, 2004 at 18:20 UTC | |
|
Re: POSIX strftime format question
by TedPride (Priest) on Oct 22, 2004 at 15:39 UTC |