Subject: RE: Converting GMT time to user's local time
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 22 Jan 2007 12:36:55 -0000
|
> Is there some kind of mapping where I can match the location
> with the time-zone?
That's part of (a) and is very product dependent. On Java you can get the
Locale appropriate to a particular country, on .NET the equivalent is a
Culture. With Saxon the XSLT processor will pick up the implicit timezone
from the Java default locale, which you can set using Java calls before
invoking Saxon.
Michael Kay
http://www.saxonica.com/
>
> Thanks,
> Lalit
>
> -----Original Message-----
> From: Michael Kay [mailto:mike@xxxxxxxxxxxx]
> Sent: Monday, January 22, 2007 1:34 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: Converting GMT time to user's local time
>
> WIth XPath 2.0 you need to:
>
> (a) ensure that the implicit timezone is the user's timezone
> (that bit depends on your choice of processor)
>
> (b) convert your date and time to an xs:dateTime (remember
> that the timezone can change the date as well as the time)
>
> (c) apply the adjust-time-to-timezone function.
>
> Michael Kay
> http://www.saxonica.com/
>
> > -----Original Message-----
> > From: Lalit.Chanchlani@xxxxxxxxxxxxxxxxxx
> > [mailto:Lalit.Chanchlani@xxxxxxxxxxxxxxxxxx]
> > Sent: 22 January 2007 07:31
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject: Converting GMT time to user's local time
> >
> > All -
> > I need your help in converting GMT time to a local time of any
> > particular user using XSL.
> > I receive input XML like from the TV channel provider:
> > <channel name="HBO">
> > <movie>
> > <name>Braveheart</name>
> > <date>24JAN2006</date>
> > <showtime>21:00</showtime> </movie> </channel> The
> > <showtime> element has GMT time. I want to convert this time to a
> > user-specific time and return it to user in text format.
> Example: If a
> > user logs in from Singapore, he should see this time as his
> own local
> > time and so on.
> > Thanks.
> > - Lalit
> >
> >
> >
> >
> > DISCLAIMER:
> > This message contains privileged and confidential
> information and is
> > intended only for an individual named. If you are not the intended
> > recipient, you should not disseminate, distribute, store,
> print, copy
> > or deliver this message.
> > Please notify the sender immediately by e-mail if you have received
> > this e-mail by mistake and delete this e-mail from your
> system. E-mail
> > transmission cannot be guaranteed to be secure or error-free as
> > information could be intercepted, corrupted, lost,
> destroyed, arrive
> > late or incomplete or contain viruses. The sender, therefore, does
> > not accept liability for any errors or omissions in the contents of
> > this message which arise as a result of e-mail transmission. If
> > verification is required, please request a hard-copy version.
>
>
>
> DISCLAIMER:
> This message contains privileged and confidential information
> and is intended only for an individual named. If you are not
> the intended recipient, you should not disseminate,
> distribute, store, print, copy or deliver this message.
> Please notify the sender immediately by e-mail if you have
> received this e-mail by mistake and delete this e-mail from
> your system. E-mail transmission cannot be guaranteed to be
> secure or error-free as information could be intercepted,
> corrupted, lost, destroyed, arrive late or incomplete or
> contain viruses. The sender, therefore, does not accept
> liability for any errors or omissions in the contents of this
> message which arise as a result of e-mail transmission. If
> verification is required, please request a hard-copy version.
|