cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble converting dates to string

Highlighted
Occasional Contributor

Trouble converting dates to string

This is posted as a reminder of an unresolved issue in the newsgroups, which have become obsolete:



http://www.automatedqa.com/newsgroups/d.cgi?cmd=xover&group=automatedqa.public.testcomplete&related=...
=
3 REPLIES 3
Highlighted

RE: Trouble converting dates to string

Hello Karl,




The problem has been fixed in TestComplete 7.0. Try using the latest version of the product (TC 7.51) and check whether the problem persists.

--
Dmitry Nikolaev

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Occasional Contributor

RE: Trouble converting dates to string

No, this is not quite resolved (running TestComplete 7.52).



Now when I run the code



Log.Message(aqConvert.DateTimeToFormatStr(aqDateTime.SetDateElements(1899, 12, 31), '%Y-%m-%d'));



I get the following error:



Unable to get a formatted string for dates earlier than 1900.





However, this works OK for



Log.Message(aqConvert.DateTimeToStr(aqDateTime.SetDateElements(1899, 12, 30)));


Highlighted

RE: Trouble converting dates to string

Hi Karl,



At the moment, there are some problems with using dates earlier than 1900 in the aqConvert.DateTimeToFormatStr method - TestComplete can crash in some cases. So, we decided to limit using dates in the method: you cannot work with dates earlier than 1900. We are working on this problem.



Currently, you can use the Utilities.FormatDateTime method as a workaround. 
-----

Alexander
Customer Care Manager
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors