Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
格式化日期(Sharepoint Designer)_Sharepoint_Xpath - Fatal编程技术网

格式化日期(Sharepoint Designer)

格式化日期(Sharepoint Designer),sharepoint,xpath,Sharepoint,Xpath,我正在尝试在Sharepoint Designer中正确设置日期格式 这行代码确实有效,但我得到了虚假的结果,因为我的日期是英国格式的 <xsl:value-of select= "number(ddwrt:DateTimeTick( ddwrt:GenDisplayName(string(FormatDate(@DateSent,2057,1)))))- number(ddwrt:DateTimeTick( ddwrt:Gen

我正在尝试在Sharepoint Designer中正确设置日期格式

这行代码确实有效,但我得到了虚假的结果,因为我的日期是英国格式的

<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)))))"
/>

提前感谢。

XPath标准中没有函数
formattate(…)
。Sharepoint Designer有一个位于用于某些其他函数的
ddwrt:
命名空间中。要调用它,请添加名称空间

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

令人惊叹的!通过在@DateSent周围添加字符串()完全有效。谢谢你的帮助!
number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(ddwrt:FormatDate(string(@DateSent,2057,1))))))
-
number(ddwrt:DateTimeTick(ddwrt:GenDisplayName(string(ddwrt:FormatDate(ddwrt:Today(),2057,1)))))"