I think it's the last reboot in GMT.  Anyway, I didn't want to spend too
much time on it so this is what I did:

use DateManip;

$os_lastboot = $svruptime->{'LastBootUpTime'};
$os_lastboot = substr($os_lastboot, 0, index($os_lastboot, "."));  #
only want left of period
$os_lastboot = &DateCalc($os_lastboot, "+ 300 minutes");           #
time offset
$os_lastboot = &UnixDate($os_lastboot, "%Y-%m-%d %T");             #
convert to readable time

Stanley G. Martin
Sprint - ISS Enterprise App/Decision Support Services 
913.315.4576
913.226.3090  PCS
[EMAIL PROTECTED]


-----Original Message-----
From: dbe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 03, 2002 10:45 PM
To: MKhan
Cc: perl-win32-users
Subject: Re: Uptime of remote system??


Khan, Moin wrote:
> Hi,
> I am trying to findout the uptime of the remote NT/2000 system through

> perl script, i am using wmi in perl script to get the counter, it 
> working fine but the value is returning is difficult to understand,
code 
> is as follows:
> 
>         my
$Class="WinMgmts:{impersonationlevel=impersonate}!//$szServer";
>       my $Wmi = Win32::OLE->GetObject ($Class) or next;
>       my @Svruptime = in ($Wmi->InstancesOf
("Win32_OperatingSystem"));
>   
>         foreach my $svruptime (@Svruptime)
>         {
>         $output = $svruptime->{LastBootUpTime};
>         print "Server uptime is " . $output;
>         }
> 
> and the output is like that:
>         Server uptime is 20020903073500.000000-420
> 
> Can anyone help me on this, I really appreciate it.

Looks like a date to me (adding a few spaces, /'s and :'s):

      2002/09/03 07:35:00.000000

      Not sure what this is maybe timezone offset? -0700 ? : -420


-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for
Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic
http://www.todbe.com/

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


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

Reply via email to