cc96ai wrote:
>
> we have string of date 2005-11-01
> 
> and want to display as
> 
> November 1, 2005

How about this?

Rob


use strict;
use warnings;

use POSIX qw/strftime/;

my $date = '2005-11-01';

print pretty_date($date), "\n";

sub pretty_date {
  my @ymd = split /-/, shift;
  $ymd[0] -= 1900;
  $ymd[1] -= 1;
  my $pretty = strftime '%B %d, %Y', (0, 0, 0, reverse @ymd);
  $pretty =~ s/\b0//;
  $pretty;
}


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to