joffre
14 years agoRegular Contributor
Problems with aqDateTime
Function ActualDate
fullDate = aqDateTime.Today
Log.Message(fullDate)
tDay = aqDateTime.GetDay(fullDate)
tMonth = aqDateTime.GetMonth(fullDate)
tYear = aqDateTime.GetYear(fullDate)
dtAtual = tDay & tMonth & tYear
Log.Message(dtAtual)
End Function
I have the code above. My "fullDate" variable is returning the value "04/10/2011" and "tDay & tMonth & tYear" is returning "4102011".
The idea is to call this function from my Sub to fill some forms textBox; preventing me to edit my code every day and change the date manually.
One of my problems is that aqDateTime.GetDay is getting just the "4", and I need "04".
The other problem is that I have no idea about how to use this function in a Sub. I know that I have to make my function return the full date (without '/'), but how will I do that? I've tried the "Return variable" statement, but it didn't work.
Thanks.
Editing:
I also did as below, but my code got ugly and bigger, so I decided to do like I've showed before..
fullDate = aqDateTime.Today
dia_1 = aqString.GetChar(fullDate, 0)
dia_2 = aqString.GetChar(fullDate, 1)
Log.Message(dia_1&dia_2)
mes_1 = aqString.GetChar(fullDate, 3)
mes_2 = aqString.GetChar(fullDate, 4)
Log.Message(mes_1&mes_2)
ano_1 = aqString.GetChar(fullDate, 6)
ano_2 = aqString.GetChar(fullDate, 7)
ano_3 = aqString.GetChar(fullDate, 8)
ano_4 = aqString.GetChar(fullDate, 9)
Log.Message(ano_1&ano_2&ano_3&ano_4)