From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

LastBootUpTime Format

 

Hii,

 

I have to Wait atleast 15 mins after the PC Boots  and then start with  the test.

 

with the  "/r wmic os get lastbootuptime"  command line Argument  I do get the   Result [String]

LastBootUpTime
20160203072206.610798+060

 

but the formatting is the Issue

 

Is there any elegant way to  get the same in a  Numeric format   else I have to Parse the result   or Script  better...

 

regards

Akshay

0 Kudos
Message 1 of 2
(3,414 Views)

You could simply parse using the  System.Management assembly in a .NET step.

 

Place down a .NET action step

Set the Assembly: to System.Management

Set the Root Class: to ManagementDateTimeConverter

Set the .NET Invocation: to ToDateTime(System.String).ToLongDateString() //there are other methods here that might be a better format

Pass your string (20160203072206.610798+060 probably as a variable) to the dmtfDate when your cursor is on ToDateTime(System.String)

Move your cursor to ToLongDateString() and put the variable where you want to store it in the Return Value

 

Let me know how it works.  I'm shooting from the hip here.  See attached image.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 2
(3,403 Views)