Forum Discussion

laxsore's avatar
laxsore
New Contributor
12 years ago

aqConvert.StrToDate method

How aqConvert.StrToDate method recognize the date format.?I mean how can I detrmine if its "mm/dd/yyyy" or  "dd/mm/yyyy"?



I need to convert strings to dates and compare them.



Thanks for help
  • When I had to do this, I didn't use the aqconvert functions.  Since there is no way to determine what 02/01/20013 format is based off the string, you might need to query the application as to what it means (see if there is a mask for the control containing the date).  After that, split the string manually and construct a date manually.



    Alternatively, if you are using either .Net or Java, use the CLR bridge or Java bridge respecitly and call a native functions to build dates.
  • Hi Kazik,

    The string is converted to date according to your Regional settings.



    For exemple if your regional settings are MM/dd/YY, the string "05-06-13" will be converted in the representation of the 6th May 2013. But if your regional settings are dd/MM/YY, the date you will obtained will represent the 5th June 2013.



    Regards,

    Christophe