webservice dive matching?

Linus Torvalds torvalds at linux-foundation.org
Tue May 21 09:35:50 PDT 2013


On Tue, May 21, 2013 at 9:06 AM, Aurélien PRALONG
<aurelien.pralong at gmail.com> wrote:
>
> We already had a discution about how we should handle timezones in the
> mailing list. The problem was that the companion needs a absolute time (so
> timezones) to keep a coherent list.

Why?

This all makes no sense. The companion app should never use anything
but local-time, and that's what I remember from the discussion last
time too. You were the only one who thought it needed something else.

If you need an ID. use an ID. But make sure that that ID is never
mistaken for a date (for example, it could be a *hash* of a timestamp
or something - just to make sure that you can't use it even by mistake
as a date).

But better yet, just use the localtime. Collisions don't really
happen. Even if you were to drive between timezones and do two dives
in quick succession, why would they be exactly the same number of
hours apart? They wouldn't.

The only time that could be confusing might be if the app is set for
"do automatic samples every fifteen minutes", and because an hour is
exactly divisible by 15 minutes, and you keep moving and change the
timezone while it's on, you might have the same date repeated exactly.
But how about just setting the timer for one second longer?

That said, it looks like the current companion app doesn't even send
in seconds. *That* is a much better way to avoid duplicates than using
GMT.

               Linus


More information about the subsurface mailing list