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

setLocation #183

Open
staffanwillen opened this issue Nov 9, 2024 · 4 comments
Open

setLocation #183

staffanwillen opened this issue Nov 9, 2024 · 4 comments

Comments

@staffanwillen
Copy link

I get the wrong time zone!!! fyi lcdPrint below prints on my lcd. "Time Server Sync" works :) But after the setLocation error "Time zone error" which I always get , I seem to end up at GMT or something - anyway one hour ahead of where I am - in Stockholm/Sweden. I have tried "se", GMT-1", "Sweden/Stockholm" but to no avail. Time here is 02:28 but the HawkTZ object below reports 01:28
Please advise!!!

  Timezone HawkTZ;

 // Time Server init
  int c = 0;
  lcdPrint(1,1,"Time Server Sync");
  while (!waitForSync(1)) {
    c++;
    lcdPrint(2,1,String(c));
    if (c==10) {
      NVIC_SystemReset();
    }
   }
  lcdClear();
  if (!HawkTZ.setLocation("se")) {
     lcdPrint(1,1,"Time zone error");
     delay(4000);
  }
  lcdPrint(4,1,HawkTZ.dateTime("j/n H:i"));
@zhoyu458
Copy link

zhoyu458 commented Nov 9, 2024

Yesterday, I experienced a similar issue: no matter what location I set in the code, I always get the same time from Eztime. I tried again this morning, and everything is working fine now.

@staffanwillen
Copy link
Author

Thank you zhoyu458 for commenting. Same here. Working fine again. Guess ezTime hooks up to a server for the time zone thing, that occasionally is offline(?)

@ApRhys900
Copy link

ApRhys900 commented Nov 11, 2024

I have a similar issue. It occasionally displays the incorrect time, and upon investigation it appears to be changing to the New Zealand timezone instead of US central time that I want. In 'ezTime.h' I found the lines pertaining to the authors timezone server (timezoned.rop.nl) and decided to try some unskilled hacks.
The default timeout for this service is set at 2000 ms. I changed it to 20ms, which guarantees a timeout for me, and it started displaying the NZ time only, and never my local time. This technique duplicates the issue, I believe. So my next hack was to double the timeout value to 4000ms. It has worked correctly since, but I am still keeping an eye on it before I commit to using ezTime and not a different library. I am not skilled enough to do a more thorough analysis, and I have no idea why a server in the Netherlands would glitch to NZ time.
UPDATE: The problem is not corrected. I think I will just change to a different library.

@staffanwillen
Copy link
Author

...and it happened again this morning. setLocation("se") returns an error and I get GMT (i think) instead.
Not 100% pleased that ezTime has become unreliable. I have a great deal of sketches based on that :/

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

3 participants