JeffSm
14 years agoContributor
getting the PC's date format
Hi,
I have the need to know the PC's date format so that I can correctly enter a date field. Unfortunately, this can vary in different languages. Utilities.ShortDateFormat works, but I see that it's an obsolete property. Here's an example of what I'm doing in my script. Is there another way I should be doing this?
if (Utilities.ShortDateFormat = "M/d/yyyy")
{
// Enter Patient DOB
textBox = patientGB.textDateOfBirth;
textBox.Keys("10151960[Tab]");
}
else if (Utilities.ShortDateFormat = "yyyy/M/d")
{
// Enter Patient DOB
textBox = patientGB.textDateOfBirth;
textBox.Keys("19601015[Tab]");
}
else if (Utilities.ShortDateFormat = "d/M/yyyy")
{
// Enter Patient DOB
textBox = patientGB.textDateOfBirth;
textBox.Keys("15101960[Tab]");
}
I have the need to know the PC's date format so that I can correctly enter a date field. Unfortunately, this can vary in different languages. Utilities.ShortDateFormat works, but I see that it's an obsolete property. Here's an example of what I'm doing in my script. Is there another way I should be doing this?
if (Utilities.ShortDateFormat = "M/d/yyyy")
{
// Enter Patient DOB
textBox = patientGB.textDateOfBirth;
textBox.Keys("10151960[Tab]");
}
else if (Utilities.ShortDateFormat = "yyyy/M/d")
{
// Enter Patient DOB
textBox = patientGB.textDateOfBirth;
textBox.Keys("19601015[Tab]");
}
else if (Utilities.ShortDateFormat = "d/M/yyyy")
{
// Enter Patient DOB
textBox = patientGB.textDateOfBirth;
textBox.Keys("15101960[Tab]");
}