Page 1 of 1 1
Topic Options
#188872 - 2008-07-24 11:16 AM Formating the "$objItem.LastBootUpTime"-value
xFrog Offline
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 Offline
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 Offline
Fresh Scripter

Registered: 2008-06-05
Posts: 12
PERFECT, Thanks \:\)
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (mole) and 1300 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.049 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org