View Single Post
  #2  
Old 12-19-2003, 05:20 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,027
I think VSS actually wants the date in mm/dd/yy format. Anyway, you can tweak this code as necessary (paste into your global or project scripts in the Script Editor):

Function FormatDateVSS()
' returns the current date+time in the form
' mm/dd/yy;hh:mm[a|p]

Dim dte, h, p

dte = Now
h = Hour(dte)
If h >= 12 Then
p = "p"
h = h - 12
Else
p = "a"
If h = 0 Then h = 12
End If
FormatDateVSS = vbld_PadLeft(CStr(Month(dte)), 2, "0") & "/" & _
vbld_PadLeft(CStr(Day(dte)), 2, "0") & "/" & _
vbld_PadLeft(CStr(Year(dte)), 2, "0") & ";" & _
vbld_PadLeft(CStr(h), 2, "0") & ":" & _
vbld_PadLeft(CStr(Minute(dte)), 2, "0") & p

End Function


And use in a step field like

[FormatDateVSS]


For instance,

<step action='Log Message' type='0'>
<Message>formatted date = [FormatDateVSS]</Message>
<indent type='3'>1</indent>
<name>New Step</name>
</step>
Reply With Quote