如何在XSLT 1.0中获取当前日期时间 [英] How to get current datetime in XSLT 1.0

查看:385
本文介绍了如何在XSLT 1.0中获取当前日期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

团队,

我想在XSLT 1.0中获取当前日期时间.通过Googling,我找到了一种方法"current-dateTime()",但它在XSLT 2.0中却不受Dotnet 2.0支持.

当前要求不允许我调用任何外部C#方法.

我可以应用其他方法,过程或逻辑吗?

请帮帮我.

在此先感谢.


谢谢,
Siddharth

Hi Team,

I Want to get current datetime in XSLT 1.0. By Googling, I found a method ''current-dateTime()'', but its in XSLT 2.0 and also doesn''t supported by Dotnet 2.0

Current requirement doesn''t allow me to call any external C# method.

Is any alternate method or process or logic I can apply?

Please help me.

Thanks in Advance.


Thanks,
Siddharth

推荐答案

似乎XSLT 1.0不提供任何标准来获取当前日期/时间.您需要使用扩展功能.

使用以下脚本
It seems that XSLT 1.0 does not provide standard any to get the current date/time. You need to use an extension function.

Use the following script
<ms:script language="javascript" implements-prefix="user">
    function datediff(date1, date2)
    {
        return Math.round(((new Date(date2)) - (new Date(date1))/1000/60);
    }
</ms:script>



参考:

如何在xslt中获取当前日期,并从另一个日期减去当前日期日期? [ ^ ]

< msxsl:script>元素
[ ^ ]

如何在XSLT中获取日期时间 [



Reference:

How to get the current date in xslt, and minus this from another date?[^]

<msxsl:script> Element
[^]

How To Get DateTime In XSLT[^]


这篇关于如何在XSLT 1.0中获取当前日期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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