Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: locale warnings when exec "+" op

by PhillipHuang (Beadle)
on Nov 12, 2010 at 09:25 UTC ( [id://871013]=note: print w/replies, xml ) Need Help??


in reply to Re: locale warnings when exec "+" op
in thread locale warnings when exec "+" op

Hello zwon, thanks for your reply. I have tried to write a patch to fix this issue.
phillip@athens:~/script/Date-Handler-1.2$ cat locale.patch --- Handler.pm.original 2010-11-12 16:49:31.817657134 +0800 +++ Handler.pm 2010-11-12 16:42:35.153656643 +0800 @@ -541,7 +541,7 @@ my $epoch = $self->{epoch}; - my $newdate = ref($self)->new({ date => $epoch, time_zone => +$self->TimeZone() }); + my $newdate = ref($self)->new({ date => $epoch, time_zone => +$self->TimeZone(), locale => $self->Locale() }); my $self_array = $newdate->AsArray(); #Take care of the months. @@ -554,7 +554,7 @@ $self_array->[0] += $years; my $posix_date = ref($self)->new({ date => $self_array, - time_zone => $self->TimeZone(), + time_zone => $self->TimeZone(), locale => $s +elf->Locale() }); if($self->INTUITIVE_MONTH_CALCULATIONS())
and I find a early mistaken in first post inwhich "Date::Handler::Delta" would not include locale and timezone. here's the modified codes and run without warning messages about locale.
#!/usr/bin/perl #name: date.pl use strict; use warnings; use Date::Handler; use Date::Handler::Delta; my $delta = new Date::Handler::Delta([3,0,0,0,0,0]); my $date = new Date::Handler({ date=>time, time_zone=>'Asia/Shanghai', locale=>'zh_CN.utf8', }); my $newdate = $date + $delta; print "date=$date\n"; print "delta=$delta\n"; print "newdate=$newdate\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://871013]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-23 11:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found