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 UTC values from UDDF are not correctly shown in local time (I think) #907

Closed
2 of 4 tasks
bluppfisk opened this issue Dec 3, 2017 · 4 comments
Closed
2 of 4 tasks

Comments

@bluppfisk
Copy link

bluppfisk commented Dec 3, 2017

Describe the issue:

  • Bug
  • Change request
  • New feature request
  • Discussion request

Issue long description:

I've been working on a script to export Deepblu dive logs into UDDF format. Dive times are, I think, correctly output in UTC format. However, Subsurface does not show the times correctly for the user's timezone. I'm in UTC+8 but the times in Subsurface are still shown as if I were in the UTC timezone. I may be wrong about this. Please advise.

Operating system:

Ubuntu 16.04

Subsurface version:

Subsurface 4.7.4

Steps to reproduce:

Import an UDDF file with a tag containing a UTC value, e.g.:

                <informationbeforedive>
                    <link ref="deepblu_ds_578deabaedf5130278740868" />
                    <datetime>2017-08-08T23:34:00.000Z</datetime>
                </informationbeforedive>

(The dive actually took place on 9 August 2017 at 7:34 AM UTC+8)

Current behavior:

Subsurface accepts the file, but shows the dates and times as if the user were in UTC timezone.

Expected behavior:

Subsurface correctly determines the user's local timezone and corrects for the time difference.

@mturkia
Copy link
Collaborator

mturkia commented Dec 4, 2017

This is quite a problematic topic. In Subsurface, we have decided to store the dives always in local time with no timezone information. This IMO is what people usually want when importing from dive computers (that are usually on local time), thus ending up with sensible logs. A morning dive should have timestamp in the morning, no matter in what time zone the user happens to be when downloading/importing.

But your case is different as you are importing logs from another software that behaves differently. With a brief glimpse at UDDF logs I happen to have, it is uncommon to store timzeone information in there. Actually none of the sample logs I have from a few different sources contain timezone information.

BTW what kind of format is it that you are currently converting to UDDF?

@bluppfisk
Copy link
Author

bluppfisk commented Dec 4, 2017

The UDDF datetime specification allows for me to add timezone information to the datetime. I'm a bit unsure what to do now, as Subsurface isn't the only application using UDDF, and I'm worried that converting to local time on the exchange file level will have undesirable consequences in other applications.

I am accessing the Deepblu API and retrieving JSON data.

@atdotde
Copy link
Collaborator

atdotde commented Dec 4, 2017 via email

@bluppfisk
Copy link
Author

I am aware of the problems with timezone conversion, and I would most definitely use a library. Luckily, Deepblu also dumps a 'diveDTRaw' value which is timezone agnostic. I'll run with that, thank you both!

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

No branches or pull requests

4 participants