(aqDateTime["Today"](), "%Y%m%d") -1); problem
- 3 years ago
Hey DainiusA!
Good news here is that aqDateTime also has a AddDays function that will allow you to add or remove a specific amount of days that will adhere to the calendar.
For instance, in the code below we create variables that hold Todays date, then we subtract one from it. The AddDays function will roll the time back to the previous month if Todays date is the first of the month.
// script start
function yesterDay()
var today, yesterdayRaw, yesterdayFormatted;
today = aqDateTime.Today();
yesterdayRaw = aqDateTime.AddDays(today, -1);
yesterdayFormatted = aqConvert.DateTimeToFormatStr(yesterdayRaw, "%Y%m%d");Log["Message"]("yesterdayFormatted " + (yesterdayFormatted));
// script end
Here are some docs that cover these functions. I hope this helps!
https://support.smartbear.com/testcomplete/docs/scripting/working-with/dates/javascript.html
https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqdatetime/adddays.html