Forum Discussion

msap's avatar
msap
Frequent Contributor
6 years ago

system date retrieve

i have written below code to retrieve the system date or records created date :6/13/2018 10:42:18 AM

 

var NowValue = aqDateTime.Now();
if("Created Date"==NowValue)
{ RowIndex7 = Grid.FindRow("Created Date", NowValue);
if (RowIndex7 != -1)
Grid.ClickCell(RowIndex7, "Created Date");

log,message ("row exists)

else log.error("row not found)

 

somehow the balove script doesnot picks the value and gives row not found. any suggestions

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    aqDateTime.Now() does not return a string... it returns an object type of DateTime...  So, to compare that to a string from a grid is a mismatched comparison.  you need to convert aqDateTime.Now() to the format that matches what you're looking for in your grid.  Use aqConvert.DateTimeToFormatStr to do so.