Strange duplication of dives

Jef Driesen jefdriesen at telenet.be
Sun Dec 16 12:18:26 PST 2012


On 16-12-12 19:03, David Tillotson wrote:
> On Sun, 16 Dec 2012 09:38:25 -0800
> Linus Torvalds <torvalds at linux-foundation.org> wrote:
>> I don't know why you have dives that are more than a minute apart, but
>> that's what has happened. Did some of those dives come from an import
>> from another divelog software? Or is the sensus relative clock *so*
>> odd that it gets things wrong not by seconds, but by minutes?
>
> The shift is across a change from BST to GMT, which was what I first
> thought caused the shift, but as I mentioned elsewhere, the trip ID
> seems very odd, which was my main reason for reporting it.

A timezone change can indeed cause the final date/time to change with several 
hours. The libdivecomputer parser will sync the reefnet device clock with the 
host clock in utc, and then convert to localtime. That means localtime of the 
host sytem. Normally that's the right thing to do. But if you download the same 
dive twice, once in timezone X, and then again in other timezone Y, you'll get a 
different date/time values, with a difference equal to X - Y.

That's the reason why I would like to extend the dc_datetime_t struct with a 
timezone field that contains the utc offset. That would preserve the original 
utc timestamp. Of course it won't fix the difference due to host clock 
adjustments that you reported...

Jef


More information about the subsurface mailing list