Sunny -
TestStand does not have any expression functions to do this. You will have to either write a complex expression to attempt to determine the number of seconds, or use a code module to do the conversion.
It appears that your date format can be parsed easily. Here is a starter expression that calculates the seconds since the start of 2005. I have not validated the leap year part but I think that I have accounted for it properly...
'Assume date is stored in Locals.Date like this 22.06.2005 17:47:55,16
'Year = Mid(Locals.Date, 6, 4)
'Month = Mid(Locals.Date, 3, 2)
'Day = Mid(Locals.Date, 0, 2)
'Hour = Mid(Locals.Date, 11, 2)
'Minutes = Mid(Locals.Date, 14, 2)
'Seconds = Mid(Locals.Date, 17, 2) + Mid(Locals.Date, 20, 2)/100
Locals.Seconds =
'Years since 2005 minus 1 day per leap year
((((Val(Mid(Locals.Date, 6, 4)) - 2005) * 365 )
- Round((Val(Mid(Locals.Date, 6, 4)) - 2005)/4))
* 24 * 60 * 60)
'Months minus 1 day if after February in leap year
+ ((({0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}[Val(Mid(Locals.Date, 3, 2))] )
- Val( ( Val(Mid(Locals.Date, 3, 2))>2) && (((Val(Mid(Locals.Date, 6, 4)) - 2005)%4)==3) ))
* 24 * 60 * 60)
'Days
+ ((Val(Mid(Locals.Date, 0, 2))-1) * 24 * 60 * 60)
'Hours
+ (Val(Mid(Locals.Date, 11, 2)) * 60 * 60)
'Minutes
+ (Val(Mid(Locals.Date, 14, 2)) * 60)
' Seconds
+ (Val(Mid(Locals.Date, 17, 2)) + Val(Mid(Locals.Date, 20, 2))/100)
Scott Richardson
https://testeract.com