Example - Changing date format in test results

Explain steps to change date format in test results.

Date format varies among countries and cultures. To fit to a specific date format for XML test results, you need to edit XSLT style sheets. Suppose that you'd like to change the default date format (mm/dd/yyyy) into dd-MMM-yyyy, for example, 09-JUN-2014.

To change date time format of the Start Time built-in field from mm/dd/yyyy to dd-MMM-yyyy, perform the following steps:

  1. In a text editor such as Notepad, open the file {TA_INSTALL_DIR}\templates\xsl\common.xsl.
  2. Find <xsl:param name="format" select="'[M01]/[D01]/[Y0001] [H01]:[m01]:[s01]'"/>.
  3. Change it into the following
    <xsl:param name="format" select="'[D01]-[MN,*-3]-[Y0001] [H01]:[m01]:[s01]'"/>
    Output Expression
    31 DEC 2002 [D01] [MN,*-3] [Y0001]
    Tip: You can find additional expressions of date format here.
  4. To ensure the new changes take effect, clear the HTML cache.
    1. Open a test result's location on your machine.

    2. Delete all files located under the html_result folder.
  5. Open a test result in a web browser, or TestArchitect Client. The new date format appears.