ropg / ezTime

ezTime — pronounced "Easy Time" — is a very easy to use Arduino time and date library that provides NTP network time lookups, extensive timezone support, formatted time and date strings, user events, millisecond precision and more.
MIT License
327 stars 92 forks source link

Timezone and .setLocation need to be globals #140

Closed MikeyMoMo closed 2 years ago

MikeyMoMo commented 2 years ago
    Timezone NewZealand;
    NewZealand.setLocation("Pacific/Auckland");
    Serial.println("New Zealand time: " + NewZealand.dateTime());

When I use the first two statements, they have to be in the routine where they are used. Cannot be in Setup and cannot be listed before Setup so they get activated every call and that hits the server out at "timezoned.rop.nl". Not nice. I want to update my clock every second and have to so these three calls every time. Only want to do the last one.

MikeyMoMo commented 2 years ago

Never mind. It did not work the first time I tried it but this time, it does work as required.