Byrne, Dermot wrote:
> aha
> 
> so I'm using timelocal function now
> but I'm getting
> Undefined subroutine ::timelocal
> 
> does this mean there is a seperate timelocal module i need to install?
> 
> I've got
> /usr/lib/perl5/5.6.0/Time/Local.pm
> /usr/lib/perl5/5.6.0/Time/gmtime.pm
> /usr/lib/perl5/5.6.0/Time/localtime.pm
> /usr/lib/perl5/5.6.0/Time/tm.pm
> 
> 
> 
> 
> -----Original Message-----
> From: $Bill Luebkert [mailto:[EMAIL PROTECTED]
> Sent: 07 March 2003 14:09
> To: Byrne, Dermot
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: [Perl-unix-users] changing time from database to CET?
> 
> 
> Byrne, Dermot wrote:
>> Hello
>> 
>> As Bill suggested, here is what I have at the moment
>> 
>> $startFormatted is the date that comes out of database
>> (formatted with DATE_FORMAT( datetime, '%S %i %H %w %m %Y'))
>> 
>> # I have module
>> use Time::localtime;
>> 
>> # firstly i split variable into parts
>> my ($sec, $min, $hour, $day, $month, $year) = split(/
>> +/,$startFormatted); 
>> 
>> # but if I put into localtime function
>> my($localisedsec, $localisedmin, $localisedhour, $localisedday,
>> $localisedmonth, $localisedyear) = localtime ($sec, $min, $hour,
>> $day, $month, $year); 
>> 
>> # i get 'Too many arguments for localtime ' error
> 
> localtime takes one optional arg - an epoch time.
> Maybe you want timelocal instead ?
> 
>> when I put into localtime function like this
>> my($localisedsec, $localisedmin, $localisedhour, $localisedday,
>> $localisedmonth, $localisedyear) = localtime ($startFormatted);
>> 
>> # i doesn't mind however
>> 
>> 
>> # the statements
>> print $ENV{TZ};
>> print "<br>$startFormatted <br>";
>> print "$sec, $min, $hour, $day, $month, $year <br>";
>> print "$localisedsec, $localisedmin, $localisedhour, $localisedday,
>> $localisedmonth, $localisedyear";
>> 
>> #produce this output
>> CET
>> 00 00 14 0 03 2003
>> 00, 00, 14, 0, 03, 2003
>> 0, 0, 1, 1, 0, 70

        Add the following at start of script and should clear up problem:

use Time::Local;

Wags ;)


**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for 
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to