Forum Discussion
Anonymous
14 years agoHi Farhan,
The Today method of the aqDateTime object you used earlier returns only the current date. To obtain the current date, as well as the time, you need to use the aqDateTime.Now method. Also, I think that you will have to get back the name of the month in English, right? I've written a function that does this. Please see the following code:
Sub Test
'Returns the current date and time
today = aqDateTime.Now()
'Outputs the current date and time in the format you need
Log.Message(MonthName(aqDateTime.GetMonth(today)) + aqConvert.DateTimeToFormatStr(today, " %d,%Y %I:%M %p") )
End Sub
Function MonthName(N)
If N = 1 Then MonthName = "January"
If N = 2 Then MonthName = "February"
If N = 3 Then MonthName = "March"
If N = 4 Then MonthName = "April"
If N = 5 Then MonthName = "May"
If N = 6 Then MonthName = "June"
If N = 7 Then MonthName = "July"
If N = 8 Then MonthName = "August"
If N = 9 Then MonthName = "September"
If N = 10 Then MonthName = "October"
If N = 11 Then MonthName = "November"
If N = 12 Then MonthName = "December"
End Function