如何格式化REST连接服务数据源的数据视图中的日期字段 [英] How to format the date field in Dataview of REST Connection Service Datasource

查看:71
本文介绍了如何格式化REST连接服务数据源的数据视图中的日期字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建REST服务连接作为数据源以显示其他站点的列表.
有2列日期类型

Created REST Service Connection as Datasource to display the list from other site.
There are 2 columns which are of  Date type

StartDate和DueDate

StartDate and DueDate

如何在下面的xsl代码中应用格式

how can i apply the formatting in below xsl code

<xsl:value-of select="ddw1:content/m:properties/d:StartDate/text()" /></td><td class="ms-vb">
<xsl:value-of select="ddw1:content/m:properties/d:DueDate/text()" /></td><td class="ms-vb">

当前输出如下所示:2017-25-05T21:00:00Z

The current output is like this 2017-25-05T21:00:00Z

但是我想将日期格式设置为dd/mm/yyyy    2017年5月25日

But i want to format date as dd/mm/yyyy    25/05/2017

我如何实现这一目标.


sal

推荐答案

SB Ali,

Hi SB Ali,

尝试以下代码(第2个应根据您的要求工作):

Try below codes (2nd should work as per your requirement):

<xsl:value-of select="ddw1:FormatDate(string(@StartDate) ,1033 ,1)" /></td><td class="ms-vb">
<xsl:value-of select="ddw1:FormatDate(String(@DueDate) ,1033 ,1)" /></td><td class="ms-vb">

<xsl:value-of select="ddw1:content/m:properties/d:FormatDate(string(@StartDate) ,1033 ,1)" /></td><td class="ms-vb">
<xsl:value-of select="ddw1:content/m:properties/d:FormatDate(string(@DueDate) ,1033 ,1)" /></td><td class="ms-vb">

此致


这篇关于如何格式化REST连接服务数据源的数据视图中的日期字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆