From: Joe W. <jo...@gm...> - 2011-05-04 20:17:18
|
Hi all, The xsl:format-dateTime() function in trunk (rev. 14306) is imposing the current timezone on its output instead of respecting the timezone of its input dateTime. To see what I mean, observe how I the current dateTime's timezone is still returned in the current timezone even when I adjust it to GMT. query: xquery version "1.0"; import module namespace xsl="http://www.w3.org/1999/XSL/Transform"; let $current := current-dateTime() let $picture := 'F, DD MMMM YYYY hh:mm:ss Z' let $current-formatted := xsl:format-dateTime($current, $picture) let $adjusted-to-GMT := *adjust-dateTime-to-timezone*($current, xdt:dayTimeDuration("PT0H")) let $adjusted-formatted := xsl:format-dateTime(*$adjusted-to-GMT*, $picture) return <results> <current>{current-dateTime()}</current> <current-formatted>{$current-formatted}</current-formatted> <adjusted-to-GMT>{$adjusted-to-GMT}</adjusted-to-GMT> <adjusted-formatted>{$adjusted-formatted}</adjusted-formatted> </results> I would expect $adjusted-formatted to be GMT (*+0000*) rather than the original formatted timezone (EST *-0400*): <results> <current>2011-05-04T16:11:44.557-04:00</current> <current-formatted>Wed, 04 May 2011 04:11:44 *-0400*</current-formatted> <adjusted-to-GMT>2011-05-04T20:11:44.557Z</adjusted-to-GMT> <adjusted-formatted>Wed, 04 May 2011 04:11:44 *-0400*</adjusted-formatted> </results> Is this a bug? Or is xsl:format-dateTime() supposed to impose the current timezone on its results? Thanks, Joe |