Forum Discussion

JavierCollRodri's avatar
JavierCollRodri
Contributor
13 years ago

Issue with aqConvert.DateTimeToFormatStr


Hello,



I found a problem with aqConvert.DateTimeToFormatStr. It does not format correctly the months name. If you execute this function:



function BugaqConvert()


{


  for ( i = 1; i <= 12; i++ ) {


    d = aqDateTime.SetDateElements(2007, i, 25);


    Log.Message(i + " " + aqConvert.DateTimeToFormatStr(aqDateTime.GetMonth(d), "%B"));


  }


}



This is the result:




1 diciembre


2 enero


3 enero


4 enero


5 enero


6 enero


7 enero


8 enero


9 enero


10 enero


11 enero


12 enero




Maybe it is only a spanish issue, I can not test it with another languages.



Could anyone please test it? Or is my code wrong? (I guess it's ok)



Thank you!
  • Hello all,



    As pointed by Vince from Support Team, there was a mistake con my code:




    The DateTimeToFormatStr method requires the first parameter to be of the date/time type (the GetMonth method returns an integer value):


     


    [JScript]


    Log.Message(i + " " + aqConvert.DateTimeToFormatStr(d, "%B"));



    So it's solved,



    Thank you all