SharePoint 2010 CQWP Modified Date

less than 1 minute read

Pulling out your hair trying to find the field name for the "Last Modified Date" SharePoint 2010 field for use in ItemStyle.xsl? Here it is, with an example of how to format the date using xslt functions available to ItemStyle.xsl:

Modified On: <xsl:value-of select="ddwrt:FormatDate(string(@_x007B_28cf69c5_x002D_fa48_x002D_462a_x002D_b5cd_x002D_27b6f9d2bd5f_x007D_) ,1033 ,5)" /><br /><br />

I found the field name by dumping the names of all properties available to my xsl template using the Debug code below in ItemStyle.xsl. Once you've updated ItemStyle.xsl, create a test page in your SharePoint portal, drop in the CQWP and pick the following Debug template from the list.

<xsl:template name="Debug" match="Row[@Style='Debug']" mode="itemstyle">
        <div>
            <xsl:for-each select="@*">
                P:<xsl:value-of select="name()" /><br/>
            </xsl:for-each>
        </div>
</xsl:template>