Date formatting (Sharepoint constructor)

I am trying to format dates correctly in Sharepoint Designer.

This line of code works, but I get false results since my dates are in UK formatting.

<xsl:value-of
      select=
"number(ddwrt:DateTimeTick(
            ddwrt:GenDisplayName(string(FormatDate(@DateSent,2057,1)))))-
 number(ddwrt:DateTimeTick(
            ddwrt:GenDisplayName(string(FormatDate(ddwrt:Today(),2057,1)))))"
/>

The error I am getting is:

FormatDate is not a valid XSLT or XPath function.

Thanks in advance.

+2
source share
1 answer

There is no function in the XPath standard FormatDate(...). The Sharepoint developer has one that is in the namespace ddwrt:that you used for some other functions. To call this, add a namespace.

number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(ddwrt:FormatDate(string(@DateSent,2057,1))))))
-
number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(ddwrt:FormatDate(ddwrt:Today(),2057,1)))))"
0
source

All Articles