Convert local time to XSLT

How to convert GMT time to local time (MDT or MST) automatically.

I got this below, but I need a condition that defines utc -6 or utc -7 based on dates.

<xsl:value-of select="xs:dateTime($docdate) + xs:dayTimeDuration('-PT7H')"/>

Thanks Hari

+3


source to share


2 answers


You can take a look at a function adjust-time-to-timezone($arg as xs:time?)

that adjusts the time specified in $ arg to the implicit time zone specified in a dynamic context. There are no guarantees, but in many implementations that may be the time zone set in the operating system environment.

For example, if I evaluate the expression

adjust-time-to-timezone( xs:time('20:45:00.0+01:00'))

      



my system (current, set 7 o'clock west of UTC) returns

12:45:00-07:00

      

+2


source


You can script like javascript using javascript dates .



-1


source







All Articles