Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datetime field values differ in format #309

Open
VKTB opened this issue Jul 14, 2023 · 4 comments
Open

Datetime field values differ in format #309

VKTB opened this issue Jul 14, 2023 · 4 comments

Comments

@VKTB
Copy link
Contributor

VKTB commented Jul 14, 2023

I have an investigation in my database with the following CREATE_TIME and MOD_TIME values:

CREATE_TIME: 12-SEP-07 13.59.58.000000000
MOD_TIME: 09-MAR-20 15.19.49.823000000

When I queried for this investigation over SOAP, I noticed that the values for these fields differ in format (the former ends with +01:00 whereas the latter ends with Z):

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
    <S:Body>
        <ns2:searchResponse xmlns:ns2="http://icatproject.org">
            <return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:investigation">
                <createTime>2007-09-12T13:59:58+01:00</createTime>
                <modTime>2020-03-09T15:19:49.823Z</modTime>
            </return>
        </ns2:searchResponse>
    </S:Body>
</S:Envelope>
@RKrahl
Copy link
Member

RKrahl commented Jul 14, 2023

What database backend are you using for icat.server?

@RKrahl
Copy link
Member

RKrahl commented Jul 14, 2023

Note that if I take these dates without any time zone indication as British local time I get:

$ TZ=Europe/London date -d "2007-09-12T13:59:58" --iso-8601=second
2007-09-12T13:59:58+01:00
$ TZ=Europe/London date -d "2020-03-09T15:19:49.823" --iso-8601=second
2020-03-09T15:19:49+00:00

E.g. for the 2020-03-09 GMT is in force, whereas for the 2007-09-12 we have BST. So apparently the values you get are consistently British local time. The time zone Z is just a (ISO 8601) synonym for +00:00.

@VKTB
Copy link
Contributor Author

VKTB commented Jul 14, 2023

What database backend are you using for icat.server?

It is pointed at an Oracle database.

@RKrahl
Copy link
Member

RKrahl commented Jul 14, 2023

It is pointed at an Oracle database.

AFAIR, Oracle stores date and time values without any time zone indication. I believe, it then depends on the locale setting of the Payara process what time zone it assumes when reading those values from the database. The values you quote would then be consistent with a British locale setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants