My Web-based application (like most) follows the browser locale to format dates.
So if you configure British English as the preferred language in the browser, the ap
While it is said (by Microsoft, see https://technet.microsoft.com/en-us/library/ee176965.aspx) that GetLocale
and SetLocale
are usable only in WebPages, those functions are exactly what I was looking for. And they work within QTP.
To convert a date value from the AUT (being a string) to a VBScript date value, I
GetLocale
to fetch and save the original localeSetLocale
to switch to the same locale as the browser´s (read from registry)DateValue
to convert the string to a native date (or use any other locale-sensitive routine)SetLocale
with the original setting to switch back to the original locale.Interestingly, QTP always starts a test´s execution with the system locale active -- even if the last test execution did leave behind a different locale set active.
See f.e. https://support.microsoft.com/de-de/kb/232158/en-us