Error: RecievedDateTime failed Reason String was not recognised as a valid datetime

Version 1

    Details

     

    Using the default XSLT to create emails with the email listener for ITSM 7.x you receive an error when trying to display the date in Australian system dd,mm,yyyy : 


    Error setting value 03/19/2015 12:18:34 for field: RecievedDateTime failed

    Reason String was not recognised as a valid datetime


     


    Resolution

     

    Transform the TimeStamp field from US to AU format with the following code in the XSLT file:

    <xsl:element name="Field">
        <xsl:attribute name="Name"><xsl:text>ReceivedDateTime</xsl:text></xsl:attribute>
            <xsl:value-of select="concat(substring(TimeStamp,4,2),'/',substring(TimeStamp,1,2),'/',substring(TimeStamp,7,13))"/>
    </xsl:element>
    <xsl:element name="Field">
        <xsl:attribute name="Name"><xsl:text>SentDateTime</xsl:text></xsl:attribute>
             <xsl:value-of select="concat(substring(TimeStamp,4,2),'/',substring(TimeStamp,1,2),'/',substring(TimeStamp,7,13))"/>
    </xsl:element>