royd
8 years agoRegular Contributor
aqDateTime.Today() - date format problem.
I am getting an error while creating a new patient. The patient admission date is a month/two into the future. The admission date format calls for mm/dd/yyyy. aqDateTime.Today() produces mm/dd/yy + t...
- 8 years ago
If you want 4 digit year then you have to provide %Y instead of %y.
var currentDate = aqDateTime.Today(); var dOAdmission = aqDateTime.AddMonths(currentDate, 2); Log.Message("Today is" + aqConvert.DateTimeToFormatStr(dOAdmission, " %m/%d/%Y"));
Output[highlighted in Green] is Today is 06/24/2017 17:24:39 Normal
And for more specifiers. https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqdatetime/date-and-time-format-specifiers.html
- 8 years ago
See my commentary in the screenshot