#188872 - 2008-07-24 11:16 AM
Formating the "$objItem.LastBootUpTime"-value
|
xFrog
Fresh Scripter
Registered: 2008-06-05
Posts: 12
|
Hi all,
I found a kix-script on http://www.thescriptlibrary.com called: "List Operating System Properties". It lists properties from Win32_OperatingSystem.
There is an item called LastBootUpTime and the output looks like that: 20080724085154.499383+120
Any idea how to format this "string" to a format like: 2008/07/24/ 08:51:54
Thanks
|
|
Top
|
|
|
|
#188873 - 2008-07-24 11:38 AM
Re: Formating the "$objItem.LastBootUpTime"-value
[Re: xFrog]
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
$sLastBootTimeRaw="20080724085154.499383+120" $sLastBootTimeDisplay=SubStr($sLastBootTimeRaw,1,4)+"/" +SubStr($sLastBootTimeRaw,5,2)+"/" +SubStr($sLastBootTimeRaw,7,2)+" " +SubStr($sLastBootTimeRaw,9,2)+":" +SubStr($sLastBootTimeRaw,11,2)+":" +SubStr($sLastBootTimeRaw,13,2)
"Last boot time: "+$sLastBootTimeDisplay+@CRLF
|
|
|
Top
|
|
|
|
#188875 - 2008-07-24 01:16 PM
Re: Formating the "$objItem.LastBootUpTime"-value
[Re: Richard H.]
|
xFrog
Fresh Scripter
Registered: 2008-06-05
Posts: 12
|
PERFECT, Thanks
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 1334 anonymous users online.
|
|
|