将xs:dateTime格式化为RFC 822的正确方法是什么?
发布于 2010-10-08 07:59:06
您需要fn:format-dateTime
我认为应该是:
format-dateTime(current-dateTime(),
'[FNn,*-3], [D01] [MNn,*-3] [Y0001] [H01]:[m01]:[s01] [Z]',
'en',
'',
'US')现在,对我来说,输出:
Thu, 07 Oct 2010 21:10:03 -03:00发布于 2011-06-16 13:36:11
是啊。我添加了'AD‘作为日历,并使用SaxonHE 9.3.0.5清理了输出
fn:format-dateTime(current-dateTime(),
'[FNn,*-3], [D01] [MNn,*-3] [Y0001] [H01]:[m01]:[s01] [Z]',
'en',
'AD',
'US')发布于 2011-07-02 04:00:02
在XSL中:
<xsl:value-of select="concat(ms:format-date(InputDate, 'ddd, dd MMM yyyy'), ' ', ms:format-time(InputDate, 'HH:mm:ss'), ' EST')"/>当从数据库中检索日期时:
SELECT
Table.DateField AS InputDate
FROM Table 或者尝试:从表中选择CONVERT(NVARCHAR(10),Table.DateField,101) AS InputDate
https://stackoverflow.com/questions/3885598
复制相似问题