Saxon XSLT 2.0 和 RFC 822 日期格式

发布于 2024-09-26 21:43:37 字数 43 浏览 1 评论 0原文

将 xs:dateTime 格式化为 RFC 822 的正确方法是什么?

What is the right way to format xs:dateTime to RFC 822?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

给妤﹃绝世温柔 2024-10-03 21:43:37

你需要 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

You need fn:format-dateTime

I think it should be:

format-dateTime(current-dateTime(),
                '[FNn,*-3], [D01] [MNn,*-3] [Y0001] [H01]:[m01]:[s01] [Z]',
                'en',
                '',
                'US')

Right now, for me, output:

Thu, 07 Oct 2010 21:10:03 -03:00
So尛奶瓶 2024-10-03 21:43:37

是的。我添加了“AD”作为日历,并使用 SaxonHE 9.3.0.5 清理了输出

fn:format-dateTime(current-dateTime(),
            '[FNn,*-3], [D01] [MNn,*-3] [Y0001] [H01]:[m01]:[s01] [Z]',
            'en',
            'AD',
            'US')

Yup. I added 'AD' as the calendar and that cleaned up the output using SaxonHE 9.3.0.5

fn:format-dateTime(current-dateTime(),
            '[FNn,*-3], [D01] [MNn,*-3] [Y0001] [H01]:[m01]:[s01] [Z]',
            'en',
            'AD',
            'US')
孤君无依 2024-10-03 21:43:37

在 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 输入日期
从表

In XSL:

<xsl:value-of select="concat(ms:format-date(InputDate, 'ddd, dd MMM yyyy'), ' ', ms:format-time(InputDate, 'HH:mm:ss'), ' EST')"/>

When date was retrieved from database as:

 SELECT
      Table.DateField AS InputDate
    FROM Table 

or try :
SELECT
CONVERT(NVARCHAR(10), Table.DateField, 101) AS InputDate
FROM Table

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文