Working Time function not working

Hey there! I’m trying to use the $TimeObject->WorkingTime() function, but is not returning anything! Am I doing something wrong? I already checked the parameters, but still is not returning anything. My code is as follows: sub _getTime{ my ( $Self, %Param ) = @_; my ($startdate, $stopdate) = @_; my $ConfigObject = Kernel::Config->new(); my $EncodeObject = Kernel::System::Encode->new( ConfigObject => $ConfigObject, ); my $LogObject = Kernel::System::Log->new( ConfigObject => $ConfigObject, EncodeObject => $EncodeObject, ); my $TimeObject = Kernel::System::Time->new( ConfigObject => $ConfigObject, LogObject => $LogObject, ); my $WorkingTime = $TimeObject->WorkingTime( StartTime => '15/07/2010', #I’m using fixed dates to see if it was a problem with parameters but still it didn’t work!!! StopTime => '16/07/2010', ); # my @parts = gmtime($WorkingTime); # my ($Dd,$Dh,$Dm,$Ds)=@parts[7,2,1,0]; # my @time = ($Dd,$Dh,$Dm,$Ds); # return @time; return $WorkingTime; } Regards María Alejandra Piedra

Hi! I use OTRS 2.4.7 with Postgres 8.3 Database. After some connection (login-logout) to th OTRS service the login fails and it show me this message: ERROR: OTRS-CGI-10 Perl: 5.10.0 OS: MSWin32 Time: Thu Jul 22 12:25:17 2010 Please contact your admin Message: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. Traceback (6520): Module: Kernel::System::DB::new (v1.105.2.1) Line: 188 Module: Kernel::System::Web::InterfaceAgent::Run (v1.43.2.1) Line: 143 Module: C:/Program Files/OTRS/OTRS/bin/cgi-bin/index.pl (v1.88) Line: 48 Please..HELP ME! Marco, from Italy

Hi,
my $WorkingTime = $TimeObject->WorkingTime( StartTime => '15/07/2010', StopTime => '16/07/2010', );
method WorkingTime requires systemtime-values as parameters. Try something like my $WorkingTime = $TimeObject->WorkingTime( StartTime => '1279152000', # which is '15/07/2010' StopTime => '1279238400', # which is '16/07/2010' Calendar => $Calendar || '', ); regards, Torsten Thau -- Torsten Thau, Dipl. Inform. c.a.p.e. IT Labs GbR - Annaberger Str. 240 - D-09125 Chemnitz phone: +49 371 5347 623 cell: +49 176 66 680 680 personal pgp-key: 0x93E0A174 fax: +49 371 5347 625 http://www.cape-it.de

Hi Torsten
Ok, perfect it worked.
Now how do I do to convert my parameters into those kinds of values?
Thanks and Regards
On Sat, Jul 24, 2010 at 1:39 AM, Torsten Thau
Hi,
my $WorkingTime = $TimeObject->WorkingTime( StartTime => '15/07/2010', StopTime => '16/07/2010', );
method WorkingTime requires systemtime-values as parameters. Try something like
my $WorkingTime = $TimeObject->WorkingTime( StartTime => '1279152000', # which is '15/07/2010' StopTime => '1279238400', # which is '16/07/2010' Calendar => $Calendar || '', );
regards, Torsten Thau
-- Torsten Thau, Dipl. Inform. c.a.p.e. IT Labs GbR - Annaberger Str. 240 - D-09125 Chemnitz phone: +49 371 5347 623 cell: +49 176 66 680 680 personal pgp-key: 0x93E0A174 fax: +49 371 5347 625 http://www.cape-it.de
--------------------------------------------------------------------- OTRS mailing list: dev - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/dev To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev
NEW! ENTERPRISE SUBSCRIPTION - Get more information NOW! http://www.otrs.com/en/support/enterprise-subscription/

Hi Maria,
Ok, perfect it worked. Now how do I do to convert my parameters into those kinds of values?
please have a look at the methods of package Kernel::System::Time: http://dev.otrs.org/2.4/Kernel/System/Time.html ...especially on TimeStamp2SystemTime, which provide the functionality you need. regards, Torsten Thau -- Torsten Thau, Dipl. Inform. c.a.p.e. IT Labs GbR - Annaberger Str. 240 - D-09125 Chemnitz phone: +49 371 5347 623 cell: +49 176 66 680 680 personal pgp-key: 0x93E0A174 fax: +49 371 5347 625 http://www.cape-it.de
participants (3)
-
Maria Alejandra Piedra
-
marko.bertini@alice.it
-
Torsten Thau