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

pool.DateTime(time_t, tz) and UTCTime(time_t) are wrong #81

Open
volca02 opened this issue Apr 9, 2020 · 0 comments
Open

pool.DateTime(time_t, tz) and UTCTime(time_t) are wrong #81

volca02 opened this issue Apr 9, 2020 · 0 comments

Comments

@volca02
Copy link
Contributor

volca02 commented Apr 9, 2020

The root cause is that the constructor of DateTime(time_t, timezone) will ignore the timezone altogether, so the component part of the time specification will be offset.

#include <iostream>

#include <frpcpool.h>
#include <frpcdatetime.h>

int main() {
    FRPC::Pool_t pool;

    auto &dt = pool.UTCTime(0);

    std::cout << dt.isoFormat() << std::endl;

    return 0;
}

outputs:

19700101T01:00:00+0000

which should be

19700101T00:00:00+0000

or

19700101T01:00:00+0100
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

1 participant