Re: formatting date according to timezones?

[email protected] Mon, 7 Jan 2008 16:18:58 +0000
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <OF56718388.87A19F31-ON802573C9.005660E1-802573C9.0059A0D1@bnpparibas.com>
I think there might be a misconception here - the timezone suffix "+02:00"
means: "this is the local time in the timezone two hours ahead of UTC".

It does *not* mean "add two hours to the stated date-time to get the 'real'
date-time".

You don't state which timezone you want to express your outputs in - I'll
assume you mean UTC (Greenwich Meantime, to all intents and purposes). UTC
times may be denoted by timeszone suffix '+00:00', '-00:00', or simply 'Z'
(canonical form).

Timezones ahead of UTC have a positive offset e.g. '+01:00' would denote
Western European Time (also, British Summer Time, amongst others)

Timezones behind UTC have a negative offset e.g. '-05:00' would denote
Eastern Standard Time (also, Central Daylight Savings Time, amongst others)

Then:

2008-01-04T20:34:07.86+02:00 is the same instant-of-time as
2008-01-04T18:34:07.86Z (e.g. 8:34pm in Moscow is 6:34pm in London)
2008-01-04T20:34:07.86+05:00 is the same instant-of-time as
2008-01-04T15:34:07.86Z (e.g. 8:34pm in Islamabad is 3:34pm in London)

and:

2008-01-04T20:34:07.86-05:00 is the same instant-of-time as
2008-01-05T01:34:07Z (e.g. 8:34pm in New York is 1:34am the following
morning in London)

You can read more at http://www.w3.org/TR/2004/REC-xmlschema-2-20041028 (
W3C/XML Schema Part 2: Datatypes Second Edition), see section 3.2.7
dateTime.

And no, the esxlt date: library does not support timezone conversions
(yet). Functions such as date:add will honour (retain) timezones, but there
is no facility for automatic "canonicalisation" of timezone.

Best regards,
Harry McAllister

Fixed Income Architecture
BNP Paribas




|---------------------------------------->
|          Internet                      |
|          [email protected]        |
|                                        |
|                                        |
|          Sent by:                      |
|          [email protected]|
|          t.com                         |
|                                        |
|          07/01/2008 15:03              |
|---------------------------------------->
  >---------------------------------------------------------------------------------------------------------------|
  |                                                                                                               |
  |                                                                                                               |
  |                                                                                                             To|
  |       exslt                                                                                                   |
  |                                                                                                             cc|
  |                                                                                                               |
  |                                                                                                        Subject|
  |       [exslt] formatting date according to timezones?                                                         |
  |                                                                                                               |
  |                                                                                                               |
  |                                                                                                               |
  |                                                                                                               |
  |                                                                                                               |
  |                                                                                                               |
  >---------------------------------------------------------------------------------------------------------------|




A question regarding date formatting with exslt:

Is it possible to get the time zone taken into account, so that a new
date is calculated according to that for the output?

Some example to try to explain what I want to achieve:

for input data:
2008-01-04T20:34:07.86+02:00
i want the output to be
2008-01-04 22:34:07

for input data:
2008-01-04T20:34:07.86+05:00
should become
2008-01-05 01:34:07

and so on.

Any tips on how to achieve this?

cheers,

RJ
_______________________________________________
exslt mailing list
[email protected]
http://www.exslt.org/list



This communication is confidential, may be privileged and is meant only for the intended recipient.  If you are 
not the intended recipient, please notify the sender by reply and delete this message from your system.  Any 
unauthorised dissemination, distribution or copying hereof is prohibited.

BNP Paribas Fund Services UK Limited, BNP Paribas Trust Corporation UK Limited, BNP Paribas UK Limited, 
BNP Paribas Commodity Futures Ltd and Investment Fund Services Limited are authorised and regulated by 
the Financial Services Authority.

BNP Paribas, BNP Paribas Securities Services and BNP Paribas Private Bank are authorised by the CECEI 
and AMF.  BNP Paribas London Branch, BNP Paribas Securities Services London Branch and BNP Paribas 
Private Bank London Branch are regulated by the Financial Services Authority for the conduct of their UK 
business.  BNP Paribas Securities Services London Branch is also a member of the London Stock Exchange.