Changer l'heure? / Change hours?
Post by iconPost by breizhoneg | 2018-01-07 | 20:26:22

Salut,

Déjà merci pour ce superbe site et ce routeur!

J'ai un souci sur le Trophée Jules Verne. Sur le routeur, il est indiqué une heure de moins. Là par exemple, il est 19h20 sur mon PC (et donc mon bateau) mais i lest indiqué 18h20 sur zezo.

Du coup cela décale tout mon routeur, il prend avec les vents d'il y a une heure.

Comment peut-on changer l'heure du routeur svp?

*********************************************************************************

I will try in english,

Hello,

First thanks to this beautiful website!

I have a problem in Jules Verne Trophy, I can't change the date. Now, It's 19h20 to my computer (in France) but to this website (my router), it's 18h20.

The problem is: When I see the black line that I follow, It's the lined passed 1 hour!!

Can we change the hour of the router? I don't have this problem with Volvo or Clipper, it's strange.

Thanks a lot and excuse to my bad english

commenticon 16 Comments
Post by iconPost by zezo | 2018-01-07 | 20:35:10
It's the same moment in time, just displayed in different time zone.

I've decided to run the Jules Verne on UTC (well, they all tun on UTC under the hood now), but I decided to display the times in UTC because the GFS times are multiple of 3, but in that time zone. Otherwise the Star drop-down would be irregular (1-4-7-...)

And then the displayed future winds are not interpolated (yet) and they also coincide with 0-3-6 UTC.
Post by iconPost by GeGaX | 2018-01-07 | 21:15:23
I'm in 'standby' to implement local time on Route zezo.org but if someone wants to help me it will be with pleasure ...
You can contact me on this thread:
http://zezo.org/forum.pl?tid=6229
Post by iconPost by zezo | 2018-01-07 | 21:28:04
That won't be hard. You can safely assume CE(S)T or UTC time zone, so parsing and pretty printing in local user time zone should be matter of just few lines.

Post by iconPost by GeGaX | 2018-01-07 | 21:44:31
My problem is that I am not a developer, only a technician in marine electronics ... And I think that I reached my limits in development :/
The function that I sent you by mail, works for anywhere in the world but I do not know how I have to implement it.
Post by iconPost by zezo | 2018-01-07 | 21:46:55
I'm not a developer either. And you've done amazing job anyway. Even I use your extension to check for sail changes.
Post by iconPost by GeGaX | 2018-01-07 | 21:59:51
Someone should take a look to tell me how to implement this function (you or mak08 can be?)
I am registered on 2 forums of French developers but my problem does not interest them ...
I'm waiting for help from mcmgj but he's busy right now
The function will finally be put in place, but for the moment it's 'standby' I spent several sleepless nights during my holidays but without success
it's like that ;)

PS: it's cool that she serve you too ;)
Post by iconPost by GeGaX | 2018-01-07 | 22:10:21
the function is this one (if you ever have the time / the desire)
I have not dared to contact mak08 to ask for advice

"use strict";

var d_utc = [2018,2,25,0,59]; //CET -> CEST in 1 min (test)
//var d_utc = [2018,2,25,1,0]; //CEST OK (test)
//var d_utc = [2018,9,28,0,59]; //CEST -> CET in 1 min (test)
//var d_utc = [2018,9,28,1,0]; //CET OK (test)

function CltDTZ (d_utc) {
var d = new Date(Date.UTC.apply(null, d_utc));
var o = -d.getTimezoneOffset(), t = Math.abs(o);
var s = (o < 0) ? "-" : "+";
var h = Math.trunc(t) / 60;
var mh = (h == 0) ? "" : s + h;
var m = t % 60;
var hm = (m == 0) ? mh : s + h + ':' + m;
var Y = d.getFullYear();
var M = ("0"+ (d.getMonth() + 1)).slice(-2);
var D = ("0" + d.getDate()).slice(-2);
var HH = ("0" + d.getHours()).slice(-2);
var MM = ("0" + d.getMinutes()).slice(-2);
return Y + "-" + M + "-" + D + " " + HH + ":" + MM + " " + "UTC" + hm;
};
document.write (CltDTZ(d_utc)); //2018-03-25 01:59 UTC+1

Post by iconPost by mak08 | 2018-01-08 | 00:10:08
Hi GeGax,
feel free to contact me at michael.kappert.01@gmail.com (the address is also on the VRDashboard description page in the chrome web store).
But the function above seems to work, what is the problem?


Post by iconPost by toxcct | 2018-01-07 | 22:22:44
@GeGaX, if you can have a string in the following form "2018-12-31T13:00:00Z" where :
2018 is the year, 12 is the month, 31 is the month date, T is a literal and should be written as-is, and 13:00:00 is the time written on 24 hours format, and Z indicates it's a UTC/GMT time, then you can easily display the timestamp in any locales :

var dt = new Date("2018-12-31T13:00:00Z");
dt.toLocaleString(); //"12/31/2018, 2:00:00 PM"

(my computer is currently set in US display, located in France region, so it correctly displays in US format (MM/DD/YYYY and time correctly resolves to 14h/2PM time)
Post by iconPost by breizhoneg | 2018-01-07 | 22:24:48
ok thank you so I just have to be careful to add an hour to the hours proposed by the router for it sticks with my changes of course of my boat (sentences made with google translation french -> english)
Post by iconPost by zezo | 2018-01-07 | 22:27:02
There is a reason behind the T+xx:yy field there. 6 hours from now are 6 hours from now in any part of the world.
Post by iconPost by breizhoneg | 2018-01-07 | 22:39:24
Ah yes beautiful I had not seen this function, thank you very much :)
Post by iconPost by GeGaX | 2018-01-07 | 22:43:11
@toxcct :
Le but de cette fonction c'est quelle à le même formatage que celui du routeur ( les infobulles de chaque points noirs)
Comme Route zezo.org lit le code source et mets les données dans un tableau je souhaite garder le même formatage
J'ai dans l'idée d'un fonctionnement suivant
Route zezo.org lit les données -> une regex lit DateTime et génère les arguments -> la fonction CltDTZ -Client DateTimetimeZone- applique ce DateTimeUTC et le passe en Local -> la regex globale mets les points zezo dans le tableau mais en utilisant le DateTimeLocal
Je m'y prends peut être mal mais je vois ça comme ça ...

@toxcct:
The purpose of this function is that to the same formatting as that of the router (the tooltips of each black dots)
As Route zezo.org reads the source code and puts the data in an array I want to keep the same formatting
I have the idea of a next operation
Route zezo.org reads the data -> a regex reads DateTime and generates the arguments -> the function applies this DateTimeUTC and passes it in Local -> the global regex puts the zezo points in the array but using the DateTimeLocal
I take it can be bad but I see it like that ...

@breizhoneg : désolé de pourrir ton post / sorry to rot your post ...
Post by iconPost by breizhoneg | 2018-01-07 | 22:48:40
No problem even if I don't understand anything ^^/ pas de souci même si je ne comprends rien en langage informatique ^^
Post by iconPost by toxcct | 2018-01-07 | 23:31:05
I understand, but another point of consideration is to display a dateTime in the format the user prefers most.

If you are french, even though you are travelling far from you country, you will still find it more readable to have DateTimes in a "french" format.

That can be easily achieved by the 2 lines of code I provided, if Zezo provides UTC times.


If anyway you want to stick to the same format as Zezo, well indeed, that is more pain in the ass because you have to read the source string, be sure it is UTC (which is not garanteed that Cvetan wont change it in time), then read it, add it the correct local timezone offset, and finally output it in the same format as zezo prints it...
Post by iconPost by GeGaX | 2018-01-08 | 00:11:01
These lines of code are the ones I found at the beginning, then I could format with .replace (remove the 'à' and delete the seconds for locale FR).
But the problem is that the display differs depending on the different countries, and the formatting too
With the function I do not have to worry about it, or so I really do not understand anything :/
border
Topics list
Posts
border
4
border
border
6
border
border
8
border
border
48
border
border
17
border
border
4
border
border
48
border
border
12
border
border
Copyright 2009 by ZEZO.ORG. All Rights Reserved.