- labels: 372282 --> zsi
- milestone: 562021 -->
It seems that ZSI does not support fractions of seconds
and timezones. The following sample code shows this issue:
<dT xsi:type='xsd:dateTime'>
2005-12-23T16:08:25.343750Z</dT>
<dT xsi:type='xsd:dateTime'>
2005-12-23T16:08:25-05:00</dT>
<dT xsi:type='xsd:dateTime'>
2005-12-23T16:08:25</dT>
with code such as:
dummy=TC.TypeCode()
elt_buf = dummy.simple_value(elts[i],ps).strip()
time_buf = TC.gDateTime(None).parse(elts[i],ps)
time_buf1 =
TC.gDateTime(None).get_formatted_content(time_buf).\
strip()
... then to my mind "elt_buf" and "time_buf1" should be
equal but they are not, every dateTime of the above
example is shown like this:
2005-12-23T16:08:25Z
Time and date datatypes are internally represented by
the Python time module, which cannot store fractions of
seconds and timezones.
I propose to change it to a python datatype which
support these features, such as datetime.
Moreover the timezone is always changed to "Z" (Zulu or
UTC time), which is also incorrect, as to my mind a
time without any timezone should be left "as is", so no
timezone should be added.