Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/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
以月名、日格式xslt获取日期?_Xslt_Date_Format - Fatal编程技术网

以月名、日格式xslt获取日期?

以月名、日格式xslt获取日期?,xslt,date,format,Xslt,Date,Format,我们如何在xslt中格式化日期,比如10月18日 <xsl:value-of select="ddwrt:FormatDateTime(string(@ArticleStartDate) ,1044 ,'MM.dd.yyyy')" /> 我们如何将格式从数字MM更改为月份名称、dd和删除年份?请有人帮助 我假设,ddwrt:FormatDateTime使用CLDR时间格式。然后您可以按照XSLT2.0上的文档进行操作 format-date(@startDate, "[MNn]

我们如何在xslt中格式化日期,比如10月18日

<xsl:value-of select="ddwrt:FormatDateTime(string(@ArticleStartDate) ,1044 ,'MM.dd.yyyy')" />


我们如何将格式从数字MM更改为月份名称、dd和删除年份?请有人帮助

我假设,
ddwrt:FormatDateTime
使用CLDR时间格式。然后您可以按照XSLT2.0上的文档进行操作

format-date(@startDate, "[MNn], [D1]", "en", (), ())

您不会说您正在使用哪个XSLT版本。

如果您使用XSLT 1.0:

FormatDate(string szDate, long lcid, long formatFlag);
formatFlag可以是0到15之间的数字

<xsl:variable name="time" select="ddwrt:FormatDate(string(@EventDate), 1033, 3)" />
<xsl:variable name="subtime" select="substring-after($time, ',')" />
<xsl:variable name="restime" select="substring-before($subtime, ',')" />
<xsl:value-of select="$restime" />

结果格式:5月7日


什么是
@articlesttartdate
?@AjKancha-对,但格式是什么?这个问题被标记为XSLT。XSLT中没有
ddwrt
,XSLT 1.0中也没有
FormatDate()