문제

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

I got this below working but i need a condition which determines utc -6 or utc -7 based on dates.

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

Thanks Hari

도움이 되었습니까?

해결책

You might look at the function adjust-time-to-timezone($arg as xs:time?), which adjusts the time given in $arg to the implicit timezone given in the dynamic context. There are no guarantees, but in many implementations that is likely to be the timezone 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 to 7 hours west of UTC) returns the value

12:45:00-07:00

다른 팁

You can use a script, for example a javascript using javascript dates.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top