Skip to content

time_from_decimal_day mktime #2

@KammutierSpule

Description

@KammutierSpule

I'm not sure if this is working as expected:

  struct std::tm epoch = {0};
  epoch.tm_isdst = 0;
  epoch.tm_sec = epoch.tm_min = epoch.tm_hour = epoch.tm_mon = 0;
  epoch.tm_mday = 1;
  epoch.tm_year = 70;
  time_t local_tz_offset = mktime(&epoch);
...
  return mktime(&t) - local_tz_offset;

I'm getting local_tz_offset -3600 on my computer.

but the thing is that mktime looks is not following the timezone offsets.
In fact, what was correct to me, was to not use this local_tz_offset adjust.
Now because of the - (-3600) it gives me +1hour

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions