Re: [xsl] format-dateTime() - using the picture to adjust timezones

Subject: Re: [xsl] format-dateTime() - using the picture to adjust timezones
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Tue, 08 Sep 2009 15:56:51 +0200
tom tom wrote:

Is there a way to use the Date - Time Picture used as the second argument in the format-dateTime() (or similar) function so
that when it processes the following date:


2009-09-08T07:35:17+08:00

the month, day and year can all be rendered in UTC. The above example refers to 2009-09-07UTC. All my attempts to adjust
'[D]' to render as UTC instead of +08:00 have failed.

"adjust" is the right keyword, I think what you want to use is not a particular picture string for the format functions but rather the function adjust-dateTime-to-timezone e.g.


adjust-dateTime-to-timezone(xs:dateTime('2009-09-08T07:35:17+08:00'), xs:dayTimeDuration('PT0H'))

should adjust the dateTime to the UTC meaning you get 2009-09-07T23:35:17Z.

The you can use format-dateTime on the adjusted dateTime value.


--


	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

Current Thread