Git Product home page Git Product logo

Comments (4)

lsoltero avatar lsoltero commented on September 15, 2024

or better yet...

static inline time_t makeTime(tmElements_t &TimeElements) { return timegm(&TimeElements); }

from nmea0183.

lsoltero avatar lsoltero commented on September 15, 2024

a quick grep of the code shows localtime and mktime in other places. Might be a good to review the code for timezone issues.

from nmea0183.

ttlappalainen avatar ttlappalainen commented on September 15, 2024

I have to check - it is not that simple. In early days Arduino tim support was, what it was. It is important that any change does not cause incompamtibility to early versions so that it would suddently change behaviour in existing installations.

from nmea0183.

ttlappalainen avatar ttlappalainen commented on September 15, 2024

Arduino environment does not have timezone so that can not be used. I could bring timezone to library by with:

int32_t tNMEA0183Msg::GetTimeZone() {
  tmElements_t tme;
  SetYear(tme,1970);
  SetMonth(tme,1);
  SetDay(tme,2);
  SetHour(tme,0);
  SetMin(tme,0);
  SetSec(tme,0);

  return (int32_t )makeTime(tme)-SECS_PER_DAY;
}

If mktime implementation would have timezone in future also in Arduino, this should then work. Could you test that?
As addition there could be compiler definition
#if defined(linux)||defined(__linux)||defined(linux)
return timezone;
#else
...

from nmea0183.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.