Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

datetime error

by varalaxmibbnl (Acolyte)
on Feb 03, 2014 at 09:48 UTC ( #1073158=perlquestion: print w/ replies, xml ) Need Help??
varalaxmibbnl has asked for the wisdom of the Perl Monks concerning the following question:

hi monks when i run this script i will get the output and even few errors please some one help me to overcome this errors....thanks in advance...

#!/usr/bin/perl use strict; use DateTime; use DateTime::Format::Strptime; my $strp = DateTime::Format::Strptime->new( pattern => '%Y-%m-%d' ); # convert date to my $date = '2014-01-26'; my $dt = $strp->parse_datetime($date); my $dat = $dt->add(days => 0)->strftime("%Y-%m-%d"); my $rem1 = $dt->add(days => 7)->strftime("%Y-%m-%d"); my $rem2 = $dt->add(days => 14)->strftime("%Y-%m-%d"); print "$date\n$rem1\n$rem2\n$dat\n";

output when i run the script....

The am_pms method in DateTime::Locale::Base has been deprecated. Pleas +e see the DateTime::Locale distribution's Changes file for details at + /usr/share/perl5/DateTime/Format/Strptime.pm line 610. The default_date_format method in DateTime::Locale::Base has been depr +ecated. Please see the DateTime::Locale distribution's Changes file f +or details at /usr/share/perl5/DateTime/Format/Strptime.pm line 613. The default_time_format method in DateTime::Locale::Base has been depr +ecated. Please see the DateTime::Locale distribution's Changes file f +or details at /usr/share/perl5/DateTime/Format/Strptime.pm line 617. The default_datetime_format method in DateTime::Locale::Base has been +deprecated. Please see the DateTime::Locale distribution's Changes fi +le for details at /usr/share/perl5/DateTime/Format/Strptime.pm line 6 +21. The day_names method in DateTime::Locale::Base has been deprecated. Pl +ease see the DateTime::Locale distribution's Changes file for details + at /usr/share/perl5/DateTime/Format/Strptime.pm line 671. The day_abbreviations method in DateTime::Locale::Base has been deprec +ated. Please see the DateTime::Locale distribution's Changes file for + details at /usr/share/perl5/DateTime/Format/Strptime.pm line 671. The month_names method in DateTime::Locale::Base has been deprecated. +Please see the DateTime::Locale distribution's Changes file for detai +ls at /usr/share/perl5/DateTime/Format/Strptime.pm line 682. The month_abbreviations method in DateTime::Locale::Base has been depr +ecated. Please see the DateTime::Locale distribution's Changes file f +or details at /usr/share/perl5/DateTime/Format/Strptime.pm line 682. The am_pms method in DateTime::Locale::Base has been deprecated. Pleas +e see the DateTime::Locale distribution's Changes file for details at + /usr/share/perl5/DateTime/Format/Strptime.pm line 469. 2014-01-26 2014-02-02 2014-02-16 2014-01-26

Comment on datetime error
Select or Download Code
Re: datetime error
by vinoth.ree (Parson) on Feb 03, 2014 at 10:27 UTC

    Hi vara,

    It smells like DateTime::Locale::Base made some changes causing DateTime::Format::Strptime to shoot out warnings whenever it's used.

    Looks like they are planning to get rid of the am_pms,default_date_format,default_time_format,default_datetime_format,day_names,..etc method all together.

    Older versions of DateTime::Format::Strptime to warn like crazy. Please update DateTime::Format::Strptime to get ride of the warnings.


    All is well
Re: datetime error
by kcott (Abbot) on Feb 04, 2014 at 07:47 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1073158]
Approved by hdb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-12-29 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (186 votes), past polls