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]'"/>
    ...
    
    OutputExpression
    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.


Copyright © 2024 LogiGear Corporation. All rights reserved. LogiGear is a registered trademark, and Action Based Testing and TestArchitect are trademarks of LogiGear Corporation. All other trademarks contained herein are the property of their respective owners.

LogiGear Corporation

1730 S. Amphlett Blvd. Suite 200, San Mateo, CA 94402

Tel: +1 (650) 572-1400