Michael - There is a slight change in the requirement. Now, instead of
getting the location from the user, what I have is the <location-code>
element. I need to convert the <showtime> element which is in GMT to a
local time specific to the <location-code>.
Example:
<channel name="HBO">
<movie>
<name>Braveheart</name>
<date>24JAN2006</date>
<showtime>21:00</showtime>
<location-code>SGP</location-code>
</movie>
</channel>
Also,as you suggested to set the default locale, is it correct to set
the default locale everytime I encounter a different location ?
Regards,
Lalit
-----Original Message-----
From: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com]
Sent: Monday, January 22, 2007 6:07 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Converting GMT time to user's local time
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(_at_)saxonica(_dot_)com]
Sent: Monday, January 22, 2007 1:34 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] 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(_dot_)Chanchlani(_at_)iflexsolutions(_dot_)com
[mailto:Lalit(_dot_)Chanchlani(_at_)iflexsolutions(_dot_)com]
Sent: 22 January 2007 07:31
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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.
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
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.
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
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.
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--