Re: How to convert the date ?

2008-07-24 Thread Rob Dixon

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/




How to convert the date ?

2008-07-23 Thread cc96ai
we have string of date 2005-11-01

and want to display as

November 1, 2005

THanks


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




Re: How to convert the date ?

2008-07-23 Thread David Romero
The Date::Format and Date::Parse Modules are useful for manipulate dates
yuo can see the documentation of this modules on http://search.cpan.org



On Wed, Jul 23, 2008 at 5:28 PM, cc96ai [EMAIL PROTECTED] wrote:
 we have string of date 2005-11-01

 and want to display as

 November 1, 2005

 THanks


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






-- 
David Romero
www.factufacil.com.mx

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