Forum Discussion
tristaanogre
14 years agoEsteemed Contributor
You'll want to use a combination of aqDateTime and aqConvert objects. So, the following function will write to the log today's date minus 5 days...
You'll need to adapt it for VBScript but this should demonstrate how to use those two object.
Relevant documentation:
http://smartbear.com/support/viewarticle/13474/ - aqDateTime.Now
http://smartbear.com/support/viewarticle/13488/ - aqDateTime.AddDays
http://smartbear.com/support/viewarticle/13451/ - aqConvert.DateTimeToFormatStr
function tada()
{
var TodaysDate = aqDateTime.Now()
var FiveDaysAgo = aqDateTime.AddDays(TodaysDate, -5)
var FormattedDate = aqConvert.DateTimeToFormatStr(FiveDaysAgo, "%m%d%Y")
Log.Message(FormattedDate)
}
You'll need to adapt it for VBScript but this should demonstrate how to use those two object.
Relevant documentation:
http://smartbear.com/support/viewarticle/13474/ - aqDateTime.Now
http://smartbear.com/support/viewarticle/13488/ - aqDateTime.AddDays
http://smartbear.com/support/viewarticle/13451/ - aqConvert.DateTimeToFormatStr