08-20-2008 10:08 AM
I am having a problem trying to add milliseconds to a time channel entry. Currently I am using the DateAdd Function but it does not work.
The millisecond range is in bold in the following text.
07/01/2008 10:05:00.0000 ' I am getting this out
07/01/2008 10:05:00.3000 ' I need this out
The following script is an example of what I am trying to do
dim MuteStartTime
dim MuteDurTime
dim mutestoptime
MuteStartTime = Now
MuteDurTime = ".3"
MuteStopTime = DateAdd("s", MuteDurTime, MuteStartTime)
msgbox "(Start " & RTT(MuteStartTime) & ") + (Duration " & MuteDurTime & " Sec) = (Stop " & RTT(MuteStopTime)&")"
08-20-2008 01:02 PM
Hello BBANACKI!
The MS script documentation describes the second parameter as a long value and it will be converted to a long if it is not!
IMHO it is not a god idea to mixup VBS and DIAdem Date/Time functions. You can do what you want verry easy with pure DIAdem functions. The code will demonstrate this:Option Explicit
Dim MuteStartTime
Dim MuteDurTime
Dim MuteStopTime
' preset variables
MuteStartTime = CurrDateTimeReal
MuteDurTime = 0.3 '!!! no string!
' DIAdem Date/Time is a real with 1s accurancy
MuteStopTime = MuteStartTime + MuteDurTime
' show result
MsgBox "Start " & RTT(MuteStartTime) & " + (Duration " & MuteDurTime & " Sec) = (Stop " & RTT(MuteStopTime)&""
Matthias
Matthias Alleweldt Project Engineer / Projektingenieur | Twigeater? |
08-21-2008 10:19 AM
Thank you,
Problem solved