如何在 XSLT 1.0 中激活夏令时打印 Timezone GMT+1 或 GMT+2 [英] How to print Timezone GMT+1 or GMT+2 when time summer is activated in XSLT 1.0

查看:18
本文介绍了如何在 XSLT 1.0 中激活夏令时打印 Timezone GMT+1 或 GMT+2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想看看当夏令时激活并以从 XSLT 文件类型化的 PDF 文件开始时,是否有可能将时区从 GMT+1 更改为 GMT+2,现在时区的值是硬编码的:

I want to see if there's any possibillty to change Time Zone from GMT+1 to GMT+2 when daylight save activated and started in PDF file genreted from XSLT file now the value of time zone is hardcoded :

<xsl:value-of select="payment/@date-produce" />
(GMT+1)

所以请你帮我自动化这个谢谢.

so please can you help me to automatize this thanks.

推荐答案

XSLT 1.0 中没有标准函数可以帮助解决这个问题,EXSLT 日期/时间库也没有帮助.您需要编写自己的扩展程序.

There's no standard function in XSLT 1.0 that will help with this, and the EXSLT date/time library won't help either. You'll need to write your own extension.

在 XSLT 2.0/3.0 中的 format-dateTime() 函数,如果给定一个时区,例如America/New_York"作为第 5 个参数,将根据该地方的当地时间调整并显示该值,包括夏令时时间.

In XSLT 2.0/3.0 the format-dateTime() function, if given a timezone such as "America/New_York" as the 5th argument, will adjust and display the value according to the local time in that place, including daylight savings time.

这篇关于如何在 XSLT 1.0 中激活夏令时打印 Timezone GMT+1 或 GMT+2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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