Utilities.ReplaceTime Method

Applies to TestComplete 15.10, last modified on December 01, 2021
This method is obsolete. See the Remarks section below.


The Utilities.ReplaceTime method changes the value of the DateTime parameter so that it has the same time as the NewTime parameter. The date portion of DateTime remains untouched. ReplaceTime supports negative dates (before 1900).


Utilities.ReplaceTime(DateTime, NewTime)

DateTime [in, out]    Required    Variant    
NewTime [in]    Required    Variant    
Result None

Applies To

The method is applied to the following object:


The method has the following parameters:


The Variant value holding the date and time value whose time part should be changed. This parameter also holds the changed value.


The Variant value storing the new time.

Result Value



The ReplaceTime function does not work in JScript, C++Script and C#Script languages, since these languages do not support parameters of the out type.

This method is obsolete. It is supported for backward compatibility only. To modify the time part of a DateTime value, use the aqDateTime.SetTimeElements method.

See Also

Working With Time
SetTimeElements Method
SetDateElements Method
Now Method
Time Method
StrToTime Method
StrToDateTime Method

Highlight search results