0
use DateTime::Format::RFC3339;

my $format = DateTime::Format::RFC3339->new();
my $dt = $format->parse_datetime('1996-08-29T00:00:00.0000Z');
say $dt->strftime('%d-%b-%Y');  # 29-Aug-1996

when i run this scripts I get the error below:

Missing right curly or square bracket at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DateTime/Locale/Base.pm line 1, at end of line syntax error at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/DateTime/Locale/Base.pm line 1, at EOF


Besides base.pm was copied from cpan http://cpansearch.perl.org/src/DROLSKY/DateTime-Locale-0.45/lib/DateTime/Locale/Base.pm

Filip Roséen - refp
  • 62,493
  • 20
  • 150
  • 196
Zann
  • 85
  • 1
  • 2
  • 8

2 Answers2

1

The current version of DateTime is 0.75, DateTime-Format-RFC3339 is 1.0.5.

To install the modules properly, see What's the easiest way to install a missing Perl module?.

Community
  • 1
  • 1
daxim
  • 39,270
  • 4
  • 65
  • 132
-2

I use DateTime for the more complex stuff. For simple parse/format I do this:

use warnings;
use strict;

use Date::Parse;
use Date::Format;

my $dt = str2time('1996-08-29T00:00:00.0000Z');
print time2str('%d-%b-%Y', $dt); 
Bill Ruppert
  • 8,956
  • 7
  • 27
  • 44
  • @downvoter - Does the guy actually want to debug DateTime or format a date? – Bill Ruppert Jun 18 '12 at 12:23
  • What the OP wants is in this question's subject. But think through what you wrote: how does recommending a different module help if the OP has weird ideas about deploying them? Have a guess what happens next. – A good answer should take into account the problem at hand. – daxim Jun 18 '12 at 17:00